Mam prawie hello worlda w Javie (jest jeszcze Scanner, żeby się nie zamykała). Przy stercie ustawionej na 8MB jeszcze się uruchamia, ale jak schodzę do 4MB to wywala się na etapie kompilacji.
java -Xmx4m -Xint .\test.java
An exception has occurred in the compiler (16). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.regex.Pattern.escape(Pattern.java:2515)
at java.base/java.util.regex.Pattern.atom(Pattern.java:2286)
at java.base/java.util.regex.Pattern.sequence(Pattern.java:2159)
at java.base/java.util.regex.Pattern.expr(Pattern.java:2069)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1783)
at java.base/java.util.regex.Pattern.<init>(Pattern.java:1430)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1069)
at java.base/java.util.regex.Pattern.matches(Pattern.java:1174)
at java.base/java.lang.String.matches(String.java:2042)
at java.compiler@16/javax.tools.JavaFileManager$Location.isModuleOrientedLocation(JavaFileManager.java:170)
at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.checkNotModuleOrientedLocation(JavacFileManager.java:1283)
at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.inferBinaryName(JavacFileManager.java:785)
at java.compiler@16/javax.tools.ForwardingJavaFileManager.inferBinaryName(ForwardingJavaFileManager.java:87)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:721)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanModulePaths(ClassFinder.java:609)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:558)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:300)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder$$Lambda$46/0x0000000800c923e8.complete(Unknown Source)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:681)
at jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.members(Symbol.java:1175)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.resolveImports(TypeEnter.java:357)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.runPhase(TypeEnter.java:325)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.doCompleteEnvs(TypeEnter.java:286)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:255)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.complete(TypeEnter.java:202)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:681)
at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1409)
at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:584)
at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:561)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1069)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:936)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
error: compilation failed
Macie pomysł, jakie jeszcze można parametry dorzucić, żeby zredukować zużycie pamięci?
szatkus