1

I need help to figure out what is the problem with my current setup, cause it seems that when I fire a javafx application, looking at the activity monitor I see memory growing very rapidly and never shrinking.

My system is: Kubuntu wili, jdk 8u66 64 bit, hp envy laptop with 8 gigs of ram.

My test is: launch Ensemble8 sample application from oracle this way:

java -jar -XX:+UseG1GC -Dprism.verbose=true Ensemble8.jar

where first option is supposed to help the jvm releasing memory to the system, and the second is a debugging option for the rendering system prism.

As soon as I launch it, application memory is 142.400 Kb which is fine by me. I scroll down and click on the "service" example and click on the button "refresh" (which starts an animation, my first guess about where the problem is) and memory jumps to 186.764 Kb. Pressing it again I get:

232 Mb
290 Mb
340 Mb
514 Mb
618 Mb
720 Mb

and so on... Now it's very easy to fill up the system memory just by keep pressing the button.

It seems to me that there is a huge problem with the garbage collector, on the linux system, because when I do the test on my Windows 10 partition, I don't have such problems, meaning that the memory is released, stabilizing at around 200 Mb. My suspicion about the animation is because I first experienced this issue on an app I did which hogged the system just by animating a scrollbar.

Anybody else experiencing memory issues with javafx 8 on a linux 64 bit system?

gasdia73
  • 51
  • 3
  • Does it eventually crash with OOM? Then analyse the dump using memory analyser.. – Jayan Dec 07 '15 at 06:28
  • what happens eventually is I loose control of the system, not being able to even switch tasks, but I've not had any OutOfMemory so far – gasdia73 Dec 07 '15 at 08:27
  • I was able to do the test in a kubuntu wily 32bit and the behavior was normal, which makes me think there is something wrong with the 64bit jvm or the 64bit os, or maybe it's just my setup, but I'd be curious to know about other people's experiences – gasdia73 Dec 09 '15 at 05:53
  • You may start the program with tight upper limit say `-Xmx600m`. If the program crashes you may able to analyse the crash. See http://stackoverflow.com/questions/2064427/recommendations-for-a-heap-analysis-tool-for-java. (jvisualvm will allow to inspect running program too) – Jayan Dec 09 '15 at 05:58
  • Javafx has memory leak issues, I have opened a bug with them when the bug system was open source. Soon they said, they will offer solution/support only we pay for support license. – user1363516 Dec 09 '15 at 07:04
  • See [this](http://stackoverflow.com/questions/40228866/optimizing-memory-leakage-in-javafx/40239829#40239829). It's most probably a memory leak in the native part (mesa OpenGL implementation). – Itai Nov 21 '16 at 20:15

0 Answers0