Skip to content

Commit 4379829

Browse files
committed
GR-13061 SVM memory monitoring enabled
1 parent 450b5fe commit 4379829

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

visualvm/graalvm/src/org/graalvm/visualvm/graalvm/svm/SVMJVMImpl.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public class SVMJVMImpl extends Jvm implements JvmstatListener {
6464
private static final String SVM_HEAP_DUMP_SUFFIX = ".hprof";
6565
private static final String SYSTEM_PROPERTY_PREFIX = "java.property.";
6666
private static final String SYSTEM_PROPERTY_REG_EXPR = SYSTEM_PROPERTY_PREFIX.replace(".", "\\.")+".*"; // NOI18N
67+
private static final String MEMORY_COUNTER_REG_EXPR = "sun\\.gc\\.generation\\..*";
6768

6869
Application application;
6970
JvmstatModel monitoredVm;
@@ -234,6 +235,9 @@ public void removeMonitoredDataListener(MonitoredDataListener l) {
234235
}
235236

236237
public String[] getGenName() {
238+
if (jvmstatModel != null) {
239+
return jvmstatModel.getGenName();
240+
}
237241
throw new UnsupportedOperationException();
238242
}
239243

@@ -250,6 +254,11 @@ public boolean isThreadMonitoringSupported() {
250254
}
251255

252256
public boolean isMemoryMonitoringSupported() {
257+
if (monitoredVm != null) {
258+
List vals = monitoredVm.findByPattern(MEMORY_COUNTER_REG_EXPR);
259+
260+
return vals != null && !vals.isEmpty();
261+
}
253262
return false;
254263
}
255264

0 commit comments

Comments
 (0)