United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7003271 Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
JDK-7003271 : Hotspot should track cumulative Java heap bytes allocated on a per-thread basis

Details
Type:
Enhancement
Submit Date:
2010-11-29
Status:
Closed
Updated Date:
2012-10-13
Project Name:
JDK
Resolved Date:
2011-01-12
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs20
Fixed Versions:
hs20 (b06)

Related Reports
Backport:
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
It's possible today to get cumulative per-thread cpu time via the ThreadMXBean.
It would be very useful to get the cumulative per-thread number of bytes
allocated in the Java heap as well for resource management purposes.

                                    

Comments
SUGGESTED FIX

An outline of a fix is

1. Add a 64-bit cumulative byte count field to the JavaThread.

2. Increment it when a TLAB is retired or when an object is allocated directly in Eden or
the old gen.  For the allocate-directly-in-Eden case, a bit of compiler IR for C1 and C2
will have to be added, plus the C++ interpreter and the various interpreters will need a
few lines of code added.

3. Export the field via an mbean or mxbean interface in management.cpp and jmm.h.
                                     
2010-11-29
EVALUATION

Ok.
                                     
2010-12-13
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/b1a2afa37ec4
                                     
2011-01-08
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/b1a2afa37ec4
                                     
2011-01-08



Hardware and Software, Engineered to Work Together