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

Out of memory and high CPU when compiling a JSP

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.2, 1.4.2_04
    • tools
    • other, sparc
    • solaris_9, windows_xp

      JDK version(s)
       
      Problem details :
      When compiling a JSP, CPU goes high and an Out of Memory error is seen. Heap shows
      many "com/sun/tools/javac v8/com/Resolve$AmbiguityError" objects.
      There also is indication of a loop.
      Customer can exhibit this problem in a simple standalone testcase below :
      import java.io.*;
      public class Test
      {
      public static void main(String args[])
      {
      String s1=t1+t2;
      }
      }
      On compilation on 1.4.2 this simple java testcase produces 100% CPU usage. But the same would not lead to 100% CPU if replaced with tools.jar of JDK 1.4.1.
      ----------------------------------------------------------------------------------------------------------
      here is the output with original 142 tools.jar
      C:\work\pmrs\11125>javac test.java
      test.java:7: cannot resolve symbol
      symbol : variable t1
      location: class Test
      String s1=t1+t2;
                ^
      test.java:7: cannot resolve symbol
      symbol : variable t2
      location: class Test
      String s1=t1+t2;
                   ^
      The system is out of resources.
      Consult the following stack trace for details.
      java.lang.OutOfMemoryError
      ----------------------------------------------------------------------------------------------------------
      here is the output after replacing 142 tools.jar with 1.4.1 tools.jar
      C:\work\pmrs\11125>javac test.java
      test.java:7: cannot resolve symbol
      symbol : variable t1
      location: class Test
      String s1=t1+t2;
                ^
      test.java:7: cannot resolve symbol
      symbol : variable t2
      location: class Test
      String s1=t1+t2;
                   ^
      2 errors
      Note: Introducing a "" in between these 2 variables solves the problem of 100% CPU, something like this. String s1=t1+""+t2;

            Unassigned Unassigned
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: