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
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
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