Garbage optimization
Web Browser, Flash Player, HTML editor, Media player for Swing and SWT
Brought to you by:
chrriis
This patch delete correctly components (button....) in web browser (i've see this with JProfiler).
jWebBrowser.delete(); //New method
jWebBrowser.disposeNativePeer();
jWebBrowser.destroyOnFinalization();
This run with dialog and frame (with Link Frame) when "dispose" method is called (WebBrowserWindowFactory).
Fred.
Rar file contains (4files) DefaultWebBrowserDecorator,WebBrowserWindowFactory,JWebBrowser,NativeComponent
Hi Fred,
When you say there is garbage, what exactly do you mean?
As far as I know, everything gets reachable by the garbage collector once you remove the component from your hierarchy, unless user code holds a reference onto some listeners or whatever else (in which case the user code has to get fixed to get rid of these references).
If you happen to know some examples where memory is retained unexpectedly, then I should try to fix it, but I definitely do not want to expose explicit disposal methods.
The only exception is the disposeNativePeer() method which allows to perform the native component destruction earlier when the component was created with the "destroyOnFinalization()" constructor option and the user knows it won't use the component anymore.
What do you think?
Cheers,
-Christopher
Hi Chrriis,
Garbage collector wish our help . Because gc destroy a reference if nobody haven't got that.
DefaultWebBrowserDecorator disclare and create components (status bar) with same variables.
This variables are auto call them I think, this is very difficult for Gc.
if we clean this hierarchy, garbage say :
"Ok! yes, i run".
Thanks for your good work.
Fred