Skip to content

Commit d1e92de

Browse files
committed
Allow unskippable OOME notifications (for each loading failure)
1 parent c57fbd7 commit d1e92de

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/HeapViewer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private static Heap createHeap(File heapFile) throws IOException {
122122
return heap;
123123
} catch (OutOfMemoryError e) {
124124
System.err.println("Out of memory in HeapViewer.createHeap: " + e.getMessage()); // NOI18N
125-
HeapUtils.handleOOME(e);
125+
HeapUtils.handleOOME(false, e);
126126
return null;
127127
} finally {
128128
if (pHandle != null) pHandle.finish();

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/java/impl/JavaFieldsPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
460460
}
461461
} catch (OutOfMemoryError e) {
462462
System.err.println("Out of memory in JavaFieldsPlugin: " + e.getMessage()); // NOI18N
463-
HeapUtils.handleOOME(e);
463+
HeapUtils.handleOOME(true, e);
464464
return new HeapViewerNode[] { new ErrorNode.OOME() };
465465
}
466466

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/java/impl/JavaReferencesPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private HeapViewerNode[] computeInstancesReferences(final InstancesWrapper insta
245245
if (Thread.currentThread().isInterrupted()) throw new InterruptedException();
246246
} catch (OutOfMemoryError e) {
247247
System.err.println("Out of memory in JavaReferencesPlugin: " + e.getMessage()); // NOI18N
248-
HeapUtils.handleOOME(e);
248+
HeapUtils.handleOOME(true, e);
249249
return new HeapViewerNode[] { new ErrorNode.OOME() };
250250
} finally {
251251
progress.finish();

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/java/impl/PathToGCRootPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ private static Collection<HeapViewerNode> computeInstancesRoots(Iterator<Instanc
313313
if (current.isInterrupted()) throw new InterruptedException();
314314
} catch (OutOfMemoryError e) {
315315
System.err.println("Out of memory in PathToGCRootPlugin: " + e.getMessage()); // NOI18N
316-
HeapUtils.handleOOME(e);
316+
HeapUtils.handleOOME(true, e);
317317
return Collections.singleton(new ErrorNode.OOME());
318318
} finally {
319319
progress.finish();

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/ui/TreeTableView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ public HeapViewerRenderer getNodeRenderer(HeapViewerNode node) {
425425
// --- OOME handling -------------------------------------------------------
426426

427427
protected void handleOOME(OutOfMemoryError e) {
428-
HeapUtils.handleOOME(e);
428+
HeapUtils.handleOOME(true, e);
429429
}
430430

431431
// --- BreadCrumbs prototype -----------------------------------------------

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/utils/HeapUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ public static String htmlize(String text) {
198198

199199
private static boolean OOME_NOTIFIED = false;
200200

201-
public static void handleOOME(OutOfMemoryError e) {
201+
public static void handleOOME(final boolean skipSuccessive, OutOfMemoryError e) {
202202
SwingUtilities.invokeLater(new Runnable() {
203203
public void run() {
204-
if (!OOME_NOTIFIED) {
204+
if (!OOME_NOTIFIED || !skipSuccessive) {
205205
OOME_NOTIFIED = true;
206206
ProfilerDialogs.displayError(Bundle.HeapUtils_OomeMsg(), Bundle.HeapUtils_OomeCaption(), null);
207207
// NOTE: might update the Xmx automatically and/or lower MoreObjectsNode.MAX_BUFFER_SIZE

0 commit comments

Comments
 (0)