diff --git a/pdxu-io/src/main/java/com/crschnick/pdxu/io/parser/TextFormatParser.java b/pdxu-io/src/main/java/com/crschnick/pdxu/io/parser/TextFormatParser.java index b092f444..77fe9f28 100644 --- a/pdxu-io/src/main/java/com/crschnick/pdxu/io/parser/TextFormatParser.java +++ b/pdxu-io/src/main/java/com/crschnick/pdxu/io/parser/TextFormatParser.java @@ -150,7 +150,11 @@ public final synchronized ArrayNode parse(String name, byte[] input, int start, // Special case for out of memory if (t instanceof OutOfMemoryError ooe) { - throw new ParseException("Not enough free RAM available to load file " + name + " with size " + (input.length / 1_000_000) + "Mb.", ooe); + long heapSize = Runtime.getRuntime().totalMemory(); + long heapMaxSize = Runtime.getRuntime().maxMemory(); + long heapFreeSize = Runtime.getRuntime().freeMemory(); + var m = "" + (heapSize / 1_000_000) + "Mb / " + (heapMaxSize / 1_000_000) + "Mb (" + (heapFreeSize / 1_000_000) + "Mb free)"; + throw new ParseException("Not enough free RAM available to load file " + name + " with size " + (input.length / 1_000_000) + "Mb. " + m, ooe); } throw new ParseException(t);