karakun / OpenWebStart

Run Web Start based applications after the release of Java 11
https://openwebstart.com
Other
425 stars 46 forks source link

JavaConsole$JavaConsoleHolder take 70% of RAM (openwebstart 1.7 and eclipse tumerin 17.0.7 #564

Open guykatz opened 12 months ago

guykatz commented 12 months ago

Hi all; I am trying to debug a RAM issue with my app (java app with swing and openwebstart). I am running openwebstart 1.7 and java 17 (tumerin) I took a heap dump when I have RAM issue and I see the report on eclipse MAT (memory analyzer tool) that instances of class JavaConsole$JavaConsoleHolder are taking most of the heap. is this to be expected? not sure what this class does and why it takes so much space. diving deeper looks like console messages are taking all the space inside this object? any guidence will help image

thanks PS: we are using log4j2.17.1 which I noticed was flagged in another thread here as problematic but I am not sure if for the same reason

AlBundy33 commented 11 months ago

see #530 and https://github.com/AdoptOpenJDK/IcedTea-Web/issues/921

Workaround 1: Enable the console and check if you application writes to stdout and try to avoid this Workaround 2: set the console to disabled (instead of hidden) Workaround 3: write a cleanup-thread that peridically clears the map (can only be done by reflection)