0

my Application uses a lot of heap (-Xmx7g) and still it will run to an OutOfMemory-Exception. So I tried to save the heap with the -XX:+HeapDumpOnOutOfMemoryError JVM-Option. But after the file was created successfully, the programm runs into this Exception: java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects

Thanks in advance

JHarzenetter
  • 1
  • 1
  • 1
  • According to [Rolf](https://stackoverflow.com/q/511013/1707353), a program should die after OutOfMemoryError is encountered. Notice, it's an extension of VirtualMachineError not Exception. So, you should expect all kinds of bad things to happen after that error is handled. – Jeff Holt Feb 14 '20 at 12:30
  • 1
    What did you expect? The `-XX:+HeapDumpOnOutOfMemoryError` does exactly what its name suggests, it creates a heap dump *on* `OutOfMemoryError` not *instead*. – Holger Feb 14 '20 at 16:53

0 Answers0