Menu

#2 Garbage optimization

open
nobody
None
5
2012-09-23
2010-04-30
No

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.

Discussion

  • Frederic-Fournier

    Rar file contains (4files) DefaultWebBrowserDecorator,WebBrowserWindowFactory,JWebBrowser,NativeComponent

     
  • Christopher Deckers

    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

     
  • Frederic-Fournier

    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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.