ah, but (1) depends on OS/VM impl and (2) depends on subclass!
most LDMs will add still more data like id.  worth doing.


Johan Compagner wrote:
> 
> yes except for subclasses that also add references (and subclasses also
> cost
> 4 bytes if i remember correctly)
> 
> So lets do it. But don't expect that it will save something everytime,
> 
> johan
> 
> 
> On 1/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>>
>> so that extra boolean was still inside the bucket allocated anyways?
>>
>> -igor
>>
>>
>> On 1/30/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
>> >
>> > nope
>> > it will not do that
>> >
>> > by default new Object() takes 8 bytes
>> >
>> > new BooleanObject () (with 1 boolean reference)
>> >
>> > will take 16 bytes (so not 9 !!!)
>> >
>> > new BooleanAndObjectReferenceObject() (1 boolean and 1 object
>> reference)
>> >
>> > will take 16 bytes
>> >
>> > Object grow with 8 bytes at the time and if i remember correctly a
>> extends
>> > cost 4 bytes, martijn?)
>> >
>> > so EmptyObjectItselfButExtendBooleanObject will take 16 bytes
>> >
>> > but
>> >
>> > EmptyObjectItselfButExtendBooleanAndObjectReferenceObject will take 24
>> > bytes
>> >
>> > johan
>> >
>> >
>> > On 1/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>> > >
>> > > what do you mean it doesnt free memory? we removed the transient
>> boolean
>> > > field from model instance. it doesnt save anything when serializing,
>> but
>> > > it
>> > > reduces the footprint in ram.
>> > >
>> > > -igor
>> > >
>> > >
>> > > On 1/30/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
>> > > >
>> > > > This is something martijn and i already discussed once for the
>> > > > loadabledetachable model i think
>> > > >
>> > > > For the simple one (one boolean and one reference object, so that
>> > class
>> > > > itself ) i doesn't directly free memory but it could be in some
>> cases
>> > > > when there is another reference is added that needs to be stored it
>> > > could
>> > > > help.
>> > > >
>> > > > But it should work fine.
>> > > >
>> > > > johan
>> > > >
>> > > >
>> > > > On 1/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>> > > > >
>> > > > > before johan has a chance to poke me, ldm.detach should read
>> > > > >
>> > > > > transientModelObject = IDetachable.DETACHED;
>> > > > >
>> > > > > not
>> > > > >
>> > > > > transientModelObject = null;
>> > > > >
>> > > > > -igor
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > On 1/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>> > > > > >
>> > > > > > jonathan and i have been brainstorming about removing private
>> > > > transient
>> > > > > > boolean attached=false from our detachable models, and after an
>> > hour
>> > > > > here is
>> > > > > > what we came up with (see attachment). i know we use some
>> custom
>> > > > > > serialization for models, etc so do you guys this is going to
>> > > > interfere
>> > > > > with
>> > > > > > that? it almost seems too simple so i am a bit suspicious. if
>> it
>> > > works
>> > > > > out
>> > > > > > it should save a fair bit of memory.
>> > > > > >
>> > > > > > one thing i know it will "break" is terracotta, it will need
>> extra
>> > > > > config
>> > > > > > to replicate what we do in readobject()
>> > > > > >
>> > > > > > -igor
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > >
>> > > > >
>> > > >
>> > > >
>> > >
>> > >
>> >
>> >
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/removing-that-pesky-transient-boolean-attached-from-detachable-models-tf3140623.html#a8709213
Sent from the Wicket - Dev mailing list archive at Nabble.com.

Reply via email to