On 24/02/2013 20:57, David Holmes wrote:
Does jstat access these values directly or only via the synchronized
methods? If the latter then the value can't be "torn" that way. The
sync method will store the value in 2 32-bit registers, and the
variable load in jstat will take two instructions, but nothing can
touch those registers.
The instrumentation/jvmstat buffer is a shared memory file so jstat
(running in a different VM) just polls the counters so there isn't any
Java-level synchronization.
-Alan.