Applet Major Flaw

Discussion in 'Java' started by Roedy Green, Oct 1, 2005.

  1. Roedy Green

    Roedy Green Guest

    Something just hit me about Applets.

    My partner leaves the browser running for weeks at a time.

    Let's say during that time 200 Applets ran. All the statics are going
    to be gradually piling up for class after class, gradually eating up
    RAM and slowing the browser!

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Oct 1, 2005
    #1
    1. Advertising

  2. "Roedy Green" <> wrote in
    message news:...
    > Something just hit me about Applets.
    >
    > My partner leaves the browser running for weeks at a time.
    >
    > Let's say during that time 200 Applets ran. All the statics are going
    > to be gradually piling up for class after class, gradually eating up
    > RAM and slowing the browser!


    Not necessarily. When an applet is destiryed, its classloader, and thus all
    of its custom classes can be collected. What would build up is only the
    system classes which have been loaded. Presumably this approaches a staedy
    state.

    Even if not, what would prevent a browser from creating a new JVM instance
    every 50 applets or so?
     
    Mike Schilling, Oct 1, 2005
    #2
    1. Advertising

  3. Roedy Green

    Roedy Green Guest

    On Sat, 01 Oct 2005 00:50:21 GMT, "Mike Schilling"
    <> wrote or quoted :

    > When an applet is destiryed, its classloader, and thus all
    >of its custom classes can be collected.


    I don't know how the Applet classloaders work. I do know that Applets
    on the same page can communicate, especially instances of the same
    Applet. That suggests all Applets on a page share a common
    classloader.

    My CurrCon applet informs all other copies of itself on page if the
    user has changed his mind about the preferred currency. But that
    information never leaks to instances running on other pages.

    That implies each page has its own classloader. I suppose it would be
    possible to compose some experiments to prove that.

    On the other hand, everyone has noticed what a pain it is to debug
    Applets. You can't get he ruddy browser to load a fresh copy of the
    Applet without shutting it down and restarting. If it had a class
    loader per page, it should be pretty trivial for the browser people to
    give you a keystroke to kill the classloader for the page and start
    afresh.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Oct 1, 2005
    #3
  4. Roedy Green wrote:
    ...
    > My CurrCon applet informs all other copies of itself on page if the
    > user has changed his mind about the preferred currency. But that
    > information never leaks to instances running on other pages.
    >
    > That implies each page has its own classloader.


    No conclusions can be drawn from that, as I understand.
    Whether the browser maker gives a new VM to applets in
    different frames/pages is mostly up to them, and might
    change from version to version.
     
    Andrew Thompson, Oct 1, 2005
    #4
  5. Roedy Green <> writes:

    > I don't know how the Applet classloaders work. I do know that
    > Applets on the same page can communicate, especially instances of
    > the same Applet. That suggests all Applets on a page share a common
    > classloader.


    No, it suggests applets are registered in a common object possibly
    provided by the system classloader, per Frame parent.
     
    Tor Iver Wilhelmsen, Oct 1, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kokwooi

    Major Major Problem With ASP.NET

    kokwooi, Sep 18, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    682
    NuTcAsE
    Sep 19, 2003
  2. Kevin

    ASP.Net design flaw!?

    Kevin, Jan 22, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    924
    Kevin
    Jan 27, 2004
  3. Jef Driesen
    Replies:
    2
    Views:
    1,716
    Jef Driesen
    Jan 12, 2006
  4. ara howard
    Replies:
    0
    Views:
    238
    ara howard
    Oct 28, 2003
  5. Replies:
    2
    Views:
    302
    Rick Johnson
    Dec 25, 2012
Loading...

Share This Page