I have a situation where a Java Applet hangs after being opened multiple times. This only happens on systems with low RAM which leads me to believe there might be a memory leak, or just insufficient memory allocated to the heap.
How can I test an applet for memory leaks? Would something like JProbe work?
I don’t think that low ram on a specific workstation is an issue.
If not specified otherwise (with
-Xmxsetting), Java applets get64MBof memory at the start. The JVM reserves this amount of RAM from the system at the very beginning, so if the system has less memory available the JVM (and thus, the Applet) will not even start.But if it starts, it’s guaranteed to have all the configured memory available.
So, if your Applet still lacks memory, there are two possibilities:
Also, you say that in the end, your applet hangs. To see what is going on, add some loging to lifecycle methods, enable Java Console, and look for exceptions.