Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations Newsgroups: comp.lang.java.programmer Subject: Re: Why "lock" functionality is introduced for all the objects? Date: Tue, 28 Jun 2011 14:54:23 -0400 Organization: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations Lines: 14 Message-ID: References: NNTP-Posting-Host: quLqbYjFExRqcR6wI1lYGQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: WinVN 0.99.12z (x86 32bit) X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5747 On 28/06/2011 2:42 PM, Patricia Shanahan wrote: > Each String instance has the following fields: > > private final char value[]; > private final int offset; > private final int count; > private int hash; > > There are 12 bytes in addition to the char array. The offset and count > fields allow quick sub-string construction, and hash is used to cache > the hashCode result. Oh, geez, even *more* overhead. And let's not forget the array has its own separate object header and length field!