From 9ed16740135f2360dd7c4dc8687058153cb1b5be Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Fri, 7 Aug 2015 09:41:30 +0000 Subject: [PATCH] PrismCL: Catch CuddOutOfMemoryException and print helpful message git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10481 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/prism/PrismCL.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/prism/src/prism/PrismCL.java b/prism/src/prism/PrismCL.java index 374ebb30..2635ddc7 100644 --- a/prism/src/prism/PrismCL.java +++ b/prism/src/prism/PrismCL.java @@ -196,8 +196,26 @@ public class PrismCL implements PrismModelListener private String[] paramUpperBounds = null; private String[] paramNames = null; - // entry point - run method + /** + * Entry point: call run method, catch CuddOutOfMemoryException + */ + public void go(String[] args) { + try { + run(args); + } catch (jdd.JDD.CuddOutOfMemoryException e) { + mainLog.println("\nError: " + e.getMessage()); + mainLog.println(" Try to restart PRISM and increase the memory available to CuDD using the -cuddmaxmem argument.\n"); + mainLog.println(" Stack trace for the failed method:"); + for (StackTraceElement st : e.getStackTrace()) { + mainLog.print(" "); + mainLog.println(st); + } + System.exit(1); + } + } + + // entry point - run method public void run(String[] args) { int i, j, k; @@ -2335,7 +2353,7 @@ public class PrismCL implements PrismModelListener public static void main(String[] args) { - new PrismCL().run(args); + new PrismCL().go(args); } }