Skip to content

Commit a3f9289

Browse files
committed
GH-410 set limit for Y value only if it is defined
1 parent ce8d435 commit a3f9289

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

visualvm/applicationviews/src/org/graalvm/visualvm/application/views/monitor/ApplicationMonitorView.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,16 @@ private void initModels(ApplicationMonitorModel model) {
503503
String USED_PERM = NbBundle.getMessage(ApplicationMonitorView.class, "LBL_Used_PermGen"); // NOI18N
504504
String USED_PERM_LEG = NbBundle.getMessage(ApplicationMonitorView.class, "LBL_Used_PermGen_leg", permgenName); // NOI18N
505505
String MAX_PERM = NbBundle.getMessage(ApplicationMonitorView.class, "LBL_Max_PermGen_size"); // NOI18N
506+
long permgenMax = model.getPermgenMax();
506507

507508
SimpleXYChartDescriptor chartDescriptor =
508509
SimpleXYChartDescriptor.bytes(10 * 1024 * 1024, false, model.getChartCache());
509510

510511
chartDescriptor.addLineFillItems(PERM_SIZE_LEG, USED_PERM_LEG);
511512
chartDescriptor.setDetailsItems(new String[] { PERM_SIZE, USED_PERM, MAX_PERM });
512-
chartDescriptor.setLimitYValue(model.getPermgenMax());
513+
if (permgenMax != -1) {
514+
chartDescriptor.setLimitYValue(permgenMax);
515+
}
513516

514517
chartSupport = ChartFactory.createSimpleXYChart(chartDescriptor);
515518
model.registerPermGenChartSupport(chartSupport);

0 commit comments

Comments
 (0)