RFR(L) 8237354: Add option to jcmd to write a gzipped heap dump

Schmelter, Ralf ralf.schmelter at sap.com
Wed Feb 19 15:24:10 UTC 2020


Hi Ioi,

> This seems to be an edge case (where your environment has more
> RAM than disk)

I would not say it's an edge case. Especially in a cloud environment, your container does not need much free diskspace, since the data is stored in a database and logging goes to stdout.

> I think it would be better to handle this outside of the JVM 
> (using a named pipe and and external program such as the parallel gzip 
> "pigz") to limit the maintenance overhead of the JVM.

But then you would have to implement writing the heap dump to a named pipe (and not only on Unix, but on Windows too). And you would still want to do the writing in background threads, so most of the code would stay. You need something like netcat on Windows. And it doesn't cover writing a heap dump on OOM via the VM flag.

And you should to compress the hprof file in a specific way, since it will make it much faster to random access the gzipped hprof file directly.

Note that I think it is a good idea to be able to write the dump to non-file destination. But removing the compression will not save much code and will make the handling messier.

Best regards,
Ralf


-----Original Message-----
From: Ioi Lam <ioi.lam at oracle.com> 
Sent: Mittwoch, 19. Februar 2020 01:16
To: serguei.spitsyn at oracle.com; Schmelter, Ralf <ralf.schmelter at sap.com>; hotspot-runtime-dev at openjdk.java.net runtime <hotspot-runtime-dev at openjdk.java.net>
Cc: Laurence Cable <larry.cable at oracle.com>; serviceability-dev at openjdk.java.net
Subject: Re: RFR(L) 8237354: Add option to jcmd to write a gzipped heap dump

Hi Ralf,

We are usually pretty picky about adding new features into the JVM. This 
seems to be an edge case (where your environment has more RAM than 
disk). I think it would be better to handle this outside of the JVM 
(using a named pipe and and external program such as the parallel gzip 
"pigz") to limit the maintenance overhead of the JVM.

This would also have the benefit that you can do it with almost no local 
storage -- you can read from the named pipe, optionally compress the 
data, and send that over the network.

Thanks
- Ioi


More information about the hotspot-runtime-dev mailing list