Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1237728

Compiler runs out of Memory for file with 100,000 statements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.0
    • tools
    • None
    • sparc
    • solaris_2.4

      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 "}"

            fyellinsunw Frank Yellin (Inactive)
            hwilliamsunw Headley Williamson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: