1.15.2 Diagnosing memory leaks

Discussion in 'Spigot Plugin Development' started by cheesyfreezy, Feb 28, 2020.

  1. Hello there,

    A plugin that I am making has a memory leak somewhere. Since the plugin is pretty big, it is hard to manually find out what is causing this. I want to be using the Memory Analyzer tool in Eclipse, but for this I need a heap dump file. I googled real quick and on there it stated that when using the parameters -XX:+HeapDumpOnOutOfMemoryError a heap dump file should be created when the heap limit was reached, but I am not getting any files.

    Can someone tell me how I am supposed to create a heap dump file?

    Thank you in advance!
     
  2. I recommend using spark for this. It doesn't officially support 1.15, but works just fine from my experience with it.
     
  3. I’ve never used Eclipse for analysis but I’m pretty sure you can get a dump to hprof which most profilers support. Something like VisualVM should be sufficient for getting heap snapshots and memory profiling.