Reporting large Java heap allocations (was Re: RMI Activity Threads Lock GC o/p)
Y Srinivas Ramakrishna
Y.S.Ramakrishna at Sun.COM
Fri Apr 4 12:40:48 PDT 2008
Hi Fino --
> Yes, there is an environment variable on AIX called
> ALLOCATION_THRESHOLD=<size in bytes> that when set will have the JVM
> send on
> error to stdout (or stderr not sure) when an allocation greater than <size
> in bytes> occurs. This could be useful, well at least for us, when dealing
> with code that sends back way too much data. By the heap blowing up, I
> mean
> a sudden huge jump in memory consumption from which the heap may have
> a real
> hard time recovering if at all. Even better would be a flag that threw
> a
> stack trace when that allocation occurs.
...
I don't think there is a jvm (or env option) w/Hotspot that would do that
(but i may be wrong).
However, I also wonder whether (with appropriate caveats, see below, on appropriate
platforms) one might be able to elicit (an approximation to) that data (at
sufficiently large values of <size_in_bytes>) by leveraging dtrace; someone
on hotspot-gc-runtime at o.j.n might be able to help, so i have cross-posted
to that list.
-- ramki
More information about the hotspot-gc-use
mailing list