[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.memory-analyzer] Re: Inconsistent display of HashMap-keys

Hi Stefan,

your observation results from the way how Strings are implemented/working.

Every String consists of a reference to a char[]. Additionally every String contains a length and an offset where the actual String inside the char[] starts. This way many Strings can 'share' one char[]... imagine all the substring methods which return a new String pointing to the same char[] with a different offset or a different length.

You can search for the incoming objects for one of the big char[]. I bet you will find not only one but many Strings ;-)

Regards,
Erwin