FWIW I counted 35 cases in the entire class library.

Tim

Tim Ellison wrote:
> Nathan Beyer wrote:
>> There may be value in doing this, but what's the increase in class file
>> overhead? Every new class that gets created for these locks ends up as
>> another class file that has to be stored (takes up drive space) and has to
>> be loaded (takes up memory in the class loader). Ever additional class file
>> takes up at least 1K of space on Windows.
>>
>> How many of these locks are we talking about?
> 
> I haven't counted, but I'd guess 10's rather than 100's based on what I
> have found so far.
> 
> Each .class files created take up about 360 bytes in the JAR file.  The
> size in memory is obviously dependent upon the VM implementation but I
> don't expect it to be onerous (in the IBM VME it will, by coincidence,
> be very roughly the same number of bytes in memory).
> 
> Regards,
> Tim
> 
> 
>>> -----Original Message-----
>>> From: Tim Ellison [mailto:[EMAIL PROTECTED]
>>> Sent: Wednesday, October 04, 2006 6:30 AM
>>> To: [email protected]
>>> Subject: Re: [classlib] Recognizing lock objects
>>>
>>> Mikhail Fursov wrote:
>>>> Another variant is to use anonymous class without the name:
>>>>    Object lock = new Object(){};
>>>>
>>>> But the name by itself (RepositionLock) serves like a comment.
>>> Yep -- I'm inclined to keep the meaningful name.
>>>
>>> Reagrds,
>>> Tim
>>>
>>>
>>>> On 10/3/06, Tim Ellison <[EMAIL PROTECTED]> wrote:
>>>>>     private class RepositionLock {}
>>>>>     private Object repositionLock = new RepositionLock();
>>>>>
>>>>>
>>> --
>>>
>>> Tim Ellison ([EMAIL PROTECTED])
>>> IBM Java technology centre, UK.
>>>
>>> ---------------------------------------------------------------------
>>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 

-- 

Tim Ellison ([EMAIL PROTECTED])
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to