0

My JavaFX (12) application appears to be leaking memory on Windows: after one night, the application consumes most of my RAM. However, this does NOT show up in the task manager - except in a way that all applications (including my app) use a minimal amount of memory (just tens of megabytes) - and memory usage is still at 99%. The memory usage returns to normal as soon as I close my app.

I really don't have even a hunch what might possibly cause this, other than that it's probably a third party library.

Any tips on how I could go on to find the cause of this? (well, excluding that I try to disable features one by one)

user38725
  • 876
  • 1
  • 10
  • 26
  • See [here](https://stackoverflow.com/questions/40119/how-to-find-a-java-memory-leak). – user1803551 May 08 '19 at 11:26
  • Are you using Intellij? – Zubty May 08 '19 at 15:47
  • 1
    Why would it not show up in Task Manager? And what indicator is showing "99%"? If not using IntelliJ, then I suggest attaching VisualVM to your Java application. You can trigger GC from its console, and create a heap dump. The heap dump can then be analyzed to find which objects are taking up most of the space. In a JavaFX application, its possible you're creating listeners or bindings from short-lived objects to long-lived objects (like models) that are causing things to stick around. – john16384 May 09 '19 at 07:08
  • I have no idea why the high memory usage doesn't show up in the Task Manager, I kind of assumed that it was a native memory leak or some such, and thus not easily found via VisualVM or the sort...? By 99% I simply meant the total memory consumption in Task Manager (the "Memory"-cell) of all the RAM I have available (6 GB). This is essentially what my application does to my system: https://superuser.com/questions/533135/98-100-memory-use-no-process-uses-more-than-25mb – user38725 May 09 '19 at 12:05
  • And yep, I'm using Intellij. Never heard of the Memory View, looks like it's a plugin...? (or a feature or Ultimate Edition?) – user38725 May 09 '19 at 12:07

1 Answers1

0

With Intellij you have an awesome tool called Memory View.

Sorry I am updating this post because in the newer versions of IntelliJ its already included.

So if you are debugging, you can find it while going to the debugging window:

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Zubty
  • 369
  • 2
  • 18