JDK-6173675 : M&M: approximate memory allocation rate/amount per thread
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,linux
  • CPU: generic,x86
  • Submitted: 2004-10-04
  • Updated: 2017-05-16
  • Resolved: 2011-04-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u25 b01Fixed 7Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
M&M: approximate memory allocation rate per thread (already prioritized as low GD)
It should be posssible to track the approximate mmemory
allocation rate per thread.
The maain purpose here is to detect a thread that has gone wild.
###@###.### 10/4/04 13:06 GMT

Comments
EVALUATION According to ###@###.### who is the author of those tests this CR is verified on b02
04-04-2011

SUGGESTED FIX Subclass the java.lang.management.ThreadMXBean interface, call it com.sun.management.ThreadMXBean. Instead of having sun.management.ThreadImpl implement j.l.m.ThreadMXBean, have it implement c.s.m.ThreadMXBean. By analogy to the existing getThreadCpuTime methods, add to c.s.m.ThreadMXBean the following methods. void long getCurrentThreadAllocatedBytes(long id); void long getThreadAllocatedBytes(long id); boolean isThreadAllocatedBytesSupported(); boolean isCurrentThreadAllocatedBytesSupported(); boolean isThreadAllocatedBytesEnabled(); void setThreadAllocatedBytesEnabled(boolean enable); In addition, add methods to c.s.m.ThreadMXBean to get info for multiple threads at once. void long[] getThreadCpuTime(long [] ids); void long[] getThreadUserTime(long [] ids); void long[] getTheadAllocatedBytes(long [] ids); The get*AllocatedBytes methods return an approximation to the number of bytes allocated by a thread or threads on the Java heap from the time it or they start executing up to the time of the call.
16-12-2010

EVALUATION One possible API would be to provide the approximate amount of per-thread allocated memory from which the rate could be calculated from it.
10-05-2006