Segment file are not deleted after parallel heap dump on Windows
jcmd <pid> GC.heap_dump -parallel=2 parallelHeapDump.bin
produces parallelHeapDump.bin
and parallelHeapDump.bin.p0
Reproducer:
update test/hotspot/jtreg/serviceability/dcmd/gc/HeapDumpParallelTest.java
add the following check in checkAndVerify method:
List<String> files
= Stream.of(heapDumpFile.getAbsoluteFile().getParentFile().listFiles())
.filter(file -> !file.isDirectory())
.map(File::getName)
.filter(name -> name.startsWith("parallelHeapDump.bin") && !name.equals("parallelHeapDump.bin"))
.collect(Collectors.toList());
if (!files.isEmpty()) {
throw new RuntimeException("Unexpected files left: " + files);
}
The test fails on Windows (release and debug) with
java.lang.RuntimeException: Unexpected files left: [parallelHeapDump.bin.p0]
Serment files are removed on unix platforms