Java Reference
In-Depth Information
Figure 6-10. Excessive allocation occurring outside of TLABs
The total memory allocated inside TLABs during this recording is 952.96 MB, and the total
memory allocated for objects outside of TLABs is 568.32 MB. This is a case where either
changing the application to use smaller objects, or tuning the JVM to allocate those objects
in larger TLABs, can have a beneficial effect. Note that there are other tabs here that can dis-
play the actual objects that were allocated out of the TLAB; we can even arrange to get the
stacks from when those objects were allocated. If there is a problem with TLAB allocation,
JFR will pinpoint it very quickly.
In the open source version of the JVM (without JFR), the best thing to do is monitor the
TLAB allocation by adding the -XX:+PrintTLAB flag to the command line. Then, at every
young collection, the GC log will contain two kinds of line: a line for each thread describing
the TLAB usage for that thread, and a summary line describing the overall TLAB usage of
the JVM.
The per-thread line looks like this:
TLAB: gc thread: 0x00007f3c10b8f800 [id: 18519] desired_size: 221KB
slow allocs: 8 refill waste: 3536B alloc: 0.01613 11058KB
refills: 73 waste 0.1% gc: 10368B slow: 2112B fast: 0B
Search WWH ::

Custom Search