views:

71

answers:

2

I've got an applet that keeps running out of memory. A heap dump analysis shows that the culprit is a char[] owned by the traceMsgQueueThread that contains the entire contents of the java console output. This grows over time as log messages are sent to the console until eventually the applet runs out of memory.

This only seems to occur for a handful of clients, and has been seen on various JREs from pre 1.5 to 1.6.0_10. All our clients run with the same parameters, i.e. -Xmx256m and -XX:+HeapDumpOnOutOfMemoryError, yet only a few exhibit this problem.

Turning the console off seemed to work in one instance, but it wasn't repeatable and unfortunately is not an option as we need the logging.

Has anyone seen this before, or know what to do about it?

A: 

There must me some option to turn off that tracing. Try virtual machine configuration or some parameter passed in the java invocation.

slipbull
+1  A: 

Under Windows, you can disable the console by going to Control Panel->Java->Advanced->Java Console. This would obviously have to be done on a machine-by-machine basis, though, and it may not even help, but I suspect that telling it not to start the console will stop that thread from being created.

skaffman
That seemed to work in one instance, but according to the client it wasn't repeatable and unfortunately is not an option as we need the logging.
Jon Pincott