Applet Major Flaw

R

Roedy Green

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

Mike Schilling

Roedy Green said:
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?
 
R

Roedy Green

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

Andrew Thompson

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

Tor Iver Wilhelmsen

Roedy Green said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top