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;
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;
- duplicates
-
JDK-6374918 Java 1.4.2_04: OutOfMemoryError at the end of the compilation
- Closed
-
JDK-4907940 StackoverflowError in javac after error report
- Resolved