United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6173675 M&M: approximate memory allocation rate/amount per thread
6173675 : M&M: approximate memory allocation rate/amount per thread

Details
Type:
Enhancement
Submit Date:
2004-10-04
Status:
Closed
Updated Date:
2011-04-04
Project Name:
JDK
Resolved Date:
2011-04-04
Component:
core-svc
OS:
linux,generic
Sub-Component:
java.lang.management
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
6u25

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

Sub Tasks

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
                                     
2011-04-04
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.
                                     
2010-12-16
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.
                                     
2006-05-10



Hardware and Software, Engineered to Work Together