Without specifics of what may be referencing those objects it is hard to say for sure, but memory details while running in dev mode will likely not reflect the compiled code. To properly test your memory patterns, compile to JavaScript with style PRETTY or DETAILED so you can read the code, and use a JavaScript memory profiler like Chrome's Inspector to hunt down any possible leaks.
For your second question, ad you saying that setWidget(null) doesn't remove the child from the SimplePanel? Which field in SimplePanel is pointing at the old child? Widget.setWidget calls remove(this.widget) which should clear out the widget field as well as detach the dom element, so I'm not clear on how 'SimplePanel doesn't release inner widget'. That said, Dev Mode's performance and memory characteristics are not going to be exactly the same as compiled code, and compiled production code is what really needs to be correct.
On Monday, October 21, 2013 3:46:14 AM UTC-5, Hakan Junior wrote:
-- For your second question, ad you saying that setWidget(null) doesn't remove the child from the SimplePanel? Which field in SimplePanel is pointing at the old child? Widget.setWidget calls remove(this.widget) which should clear out the widget field as well as detach the dom element, so I'm not clear on how 'SimplePanel doesn't release inner widget'. That said, Dev Mode's performance and memory characteristics are not going to be exactly the same as compiled code, and compiled production code is what really needs to be correct.
On Monday, October 21, 2013 3:46:14 AM UTC-5, Hakan Junior wrote:
Hi all,
I want to check my application for memory leaks. Can you help me?
I installed JProfiler 8 and attached it to debug moded jetty (ran from eclipse plugin) and checked the live heap objects. Every created component exists in the heap and never gc'ed until page refresh. When i looked at the objects i cant see a circular reference (incoming refs) except some com.gwt... classes in fields named target and/or source. Is that normal in Debug&DevMode ran from Eclipse since not translated to Javascript?
One more related important question is;
I have a composite widget named Form. Its a composition of objects and handlers. It has 3 textboxes and 1 button defined as global/field in class and created in class constructor and put to a SimplePanel area via Grid. Button has an anonymously implemented click handler. In JProfiler the anonymously implemented class instance exists in the heap and never gc'ed (same as above case, Debug&DevMode from Eclipse). And the button and the composite instances seem to be cycle referenced because of SimplePanel doesnt release inner widget. So i invoked SimplePanel object's setWidget(null) on onUnload but didnt remove buttons click handler.
At this point; Can i accept these as normal and wont worry about memory leak? or is that a really problem and i should nullify button,textboxes in the onUnload method? In anyway do i need to remove click handler from button?
Thank you all.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment