On Thu, 2 Nov 2023 06:14:59 GMT, David Holmes <dhol...@openjdk.org> wrote:

> Sorry I don't understand the fix here. You changed the AbstractDumpWriter to 
> be a C-heap object instead of ResourceObject and then delete it, so invoking 
> a destructor, which AFAICS does nothing in terms of removing any files. ???

The files are removed by DumpMerger outside of the VM operation.
On Windows opened files cannot be removed ("access denied").
DumpWriter dtor closes the file (it has `FileWriter* _writer` field; dtor 
deletes the object and FileWriter dtor closes the file).

> 
> BTW with this change you may be able to remove the ResourceMark prior to 
> allocating `local_writer` (line 2350).

VM_HeapDumper::create_local_writer() uses resource area to allocate buffer for 
file path, so ResourceMark is needed there anyway.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16462#issuecomment-1791485769

Reply via email to