TLAB pointer movement in Hotspot implementation
Chandra Shekahr Jammi
csjammi at gmail.com
Thu Aug 3 19:28:46 UTC 2017
Hi all,
We are working on a project where we want to use
com.sun.management.ThreadMXBean#getThreadAllocatedBytes(long) (
https://goo.gl/j5FDDz) to monitor a thread's memory usage via its TLAB. The
java doc says that
"some Java virtual machine implementations may use object allocation
mechanisms that result in a delay between the time an object is allocated
and the time its size is recorded".
For Hotspot implementation, we traced native call to
src/share/vm/services/management.cpp::jmm_GetThreadAllocatedMemory
and
src/share/vm/runtime/thread.inline.hpp::cooked_allocated_bytes
We are still browsing the code. But, we haven't yet figured out if
Hotspot's implementation uses object allocation mechanisms that result in a
delay between the time an object is allocated and the time its size is
recorded.
It would be much appreciated if anyone can tell us whether the mechanisms
are used in Hotspot could cause a delay. Or, even point us to the code
where our time will be best spent.
Thanks for your time
CJ
Here is the java version Im running
[root@~]# java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
More information about the hotspot-dev
mailing list