NetBeans is running with -XX:+HeapDumpOnOutOfMemoryError. When OOME occurs, JVM dumps heap dump into a predefined file in the userdir. This file is never deleted. Which means that OOME can be reported only once, for all other subsequent OOME heap dump is not written since the file is already there. What is even worse that those subsequent OOME are reported to statistics server, with the old heap dump. The one, which caused the first OOME.
There are several possibilities what to do. The most important thing to fix is to avoid reporting OOME with invalid (old) heap dump. This can be fixed by removing heap dump either in the launcher or by code which reports OOME, once the heap dump is uploaded to the server.
The ideal solution would be to report OOME after IDE restart and not in the same run, where OOME occurred, since in that context IDE is short of memory and OOME reporting itself can fail with another OOME.
Agree. i think proper fix is to rename existing heapdump during IDE start (e.g. with extension .old). This would fix the problem as well as also create space for implementing ideal solution as suggested.
First part fixed - launchers rename the old heap dump (if found) to .old
Decreasing to P3 and reassigning to exceptionreporter to take care of reporting the old heap dump as appropriate.
Integrated into 'main-golden'
User: Antonin Nebuzelsky <firstname.lastname@example.org>
Log: #203598: Obsolete heap dump left in userdir (partial - renaming old heapdump to .old)
Created attachment 129566 [details]
old heap dump left in nbproject
The second part of issue will be covered by off-line mode of ER, see issue 167163
*** Bug 206320 has been marked as a duplicate of this bug. ***