AllocationRequiringGC stacktrace precision
Milan Mimica
milan.mimica at gmail.com
Wed Jun 26 14:22:29 UTC 2019
On Thu, 13 Jun 2019 at 21:33, Milan Mimica <milan.mimica at gmail.com> wrote:
> AllocationRequiringGC event. I came across this event I can't explain:
>
> This is the top of the stack trace
> (jdk.jfr.consumer.RecordedStackTrace#getFrames):
> at java.lang.Integer#valueOf line: 1050
>
> and jdk.jfr.consumer.RecordedObject#getValue("size") says it allocated
> about 8MB.
I think I can explain this now. Method java.lang.Integer#valueOf
requested a small allocation, this allocation triggered a TLAB refill,
that in turn triggered a VM_G1CollectForAllocation
(G1CollectedHeap::attempt_allocation_slow). The confusing part is
that, along the way, the requested memory size grew from a bunch of
bytes to TLAB size. It was my wrong assumption that the size reported
by AllocationRequiringGC event is the actual allocation size demanded
by Java code. Instead, it's the the size the JVM was going to allocate
to satisfy the Java demand.
--
Milan Mimica
More information about the hotspot-jfr-dev
mailing list