Re: Panel as instance variable of parent ?

2008-11-25 Thread Timo Rantalaiho
On Mon, 24 Nov 2008, Thies Edeling wrote: I was wondering what the best aproach is, memory-wise, to reference a panel from it's parent (or other compent). Either keep a reference to a panel as an instance variable in it's parent or look it up in the hierarchy using get(path). The look up

Re: Panel as instance variable of parent ?

2008-11-24 Thread Martijn Dashorst
unless you have a clear indication that keeping the reference is causing you pain, I should not worry about it. A reference takes up 4 bytes iirc, so if you have 1024 of them in your app instance, that will take a 4kb hit. Now that is nothing to worry about. Here's a histogram snapshot (jmap

Re: Panel as instance variable of parent ?

2008-11-24 Thread Thies Edeling
Thanks! I was more worried about preventing garbage collection etc. But I guess that when a component is loaded in memory all of it's children should be as well so any reference is valid. Martijn Dashorst wrote: unless you have a clear indication that keeping the reference is causing you