Skip to content

Commit f4845e1

Browse files
committed
set max value for 'Allocated Bytes / sec' column
1 parent 410aa33 commit f4845e1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

visualvm/sampler/src/com/sun/tools/visualvm/sampler/memory/ThreadsMemoryInfo.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class ThreadsMemoryInfo {
4343
private long totalBytes;
4444
private long timestamp;
4545
private long totalDiffBytes;
46+
private long totalAllocatedBytesPerSecond;
4647

4748
ThreadsMemoryInfo(long time, ThreadInfo[] tinfo, long[] minfo) {
4849
allocatedBytesMap = new HashMap(threads.size()*4/3);
@@ -105,6 +106,11 @@ List<Long> getAllocatedBytesPerSecond(ThreadsMemoryInfo newInfo) {
105106
for (Long d : diff) {
106107
diffPerSec.add(new Long((long)(d/secs)));
107108
}
109+
totalAllocatedBytesPerSecond = (long) (getTotalDiffBytes()/secs);
108110
return diffPerSec;
109111
}
112+
113+
long getTotalAllocatedBytesPerSecond() {
114+
return totalAllocatedBytesPerSecond;
115+
}
110116
}

visualvm/sampler/src/com/sun/tools/visualvm/sampler/memory/ThreadsMemoryView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ void refresh(ThreadsMemoryInfo info) {
132132
totalBytes = info.getTotalBytes();
133133
if (currentThreadsInfo != null) {
134134
allocatedBytesPerSec = currentThreadsInfo.getAllocatedBytesPerSecond(info);
135+
renderers[1].setMaxValue(currentThreadsInfo.getTotalAllocatedBytesPerSecond());
135136
}
136137
currentThreadsInfo = info;
137138

0 commit comments

Comments
 (0)