Compiler runs out of Memory for file with 100,000 statements
I get the following error:
java.lang.OutOfMemoryError: sun.tools.tree.IdentifierExpression
at sun.tools.java.Parser.parseTerm(Parser.java:243)
at sun.tools.java.Parser.parseExpression(Parser.java:429)
at sun.tools.java.Parser.parseStatement(Parser.java:988)
at sun.tools.java.Parser.parseStatement(Parser.java:683)
at sun.tools.java.Parser.parseField(Parser.java:1290)
at sun.tools.java.Parser.parseClass(Parser.java:1510)
at sun.tools.java.Parser.parseFile(Parser.java:1602)
at sun.tools.javac.BatchEnvironment.parseFile(BatchEnvironment.java:143)
at sun.tools.javac.Main.compile(Main.java:159)
at sun.tools.javac.Main.main(Main.java:289)
error: An error has occurred in the compiler; please file a bug report (###@###.###).
TESTCASE
--------
Run the following script to generate the test case.
#!/bin/ksh
count=100000
if [[ $1 != "" ]]
then
count=$1
fi
echo
echo "class test { "
echo " public static void main (String args[]) {"
x=1
while (( "$x" <= "$count" ))
do
echo " System.out.println(\\"$x\\");"
((x=x+1))
done
echo " }"
echo "}"
I get the following error:
java.lang.OutOfMemoryError: sun.tools.tree.IdentifierExpression
at sun.tools.java.Parser.parseTerm(Parser.java:243)
at sun.tools.java.Parser.parseExpression(Parser.java:429)
at sun.tools.java.Parser.parseStatement(Parser.java:988)
at sun.tools.java.Parser.parseStatement(Parser.java:683)
at sun.tools.java.Parser.parseField(Parser.java:1290)
at sun.tools.java.Parser.parseClass(Parser.java:1510)
at sun.tools.java.Parser.parseFile(Parser.java:1602)
at sun.tools.javac.BatchEnvironment.parseFile(BatchEnvironment.java:143)
at sun.tools.javac.Main.compile(Main.java:159)
at sun.tools.javac.Main.main(Main.java:289)
error: An error has occurred in the compiler; please file a bug report (###@###.###).
TESTCASE
--------
Run the following script to generate the test case.
#!/bin/ksh
count=100000
if [[ $1 != "" ]]
then
count=$1
fi
echo
echo "class test { "
echo " public static void main (String args[]) {"
x=1
while (( "$x" <= "$count" ))
do
echo " System.out.println(\\"$x\\");"
((x=x+1))
done
echo " }"
echo "}"
- duplicates
-
JDK-1237579 compile core dumps when trying to compile 1000 deep inheritance tree
-
- Closed
-