JDK1.5 Javac performance degredation (from jasper)

We have just moved from JDK1.4.2_10 to JDK1.5.0_06 and we are experiencing problems with jsp compilation under tomcat.

The jasper compiler with the new JDK takes5 times the original time which really problematic.

I have profiled the behavior of the compilation process.

The flow as I understand it: jasper calls ant javac task which calls javac API in the same process (no fork).

Most of the time is spent injava.util.ZipFile$3.nextElement() and init()methods.

The class path of invocations in both versions is very similar (and long)

Any idea?

[625 byte] By [haimya] at [2007-10-3 2:18:14]
# 1
There has been a reported regression 6448468 - ZipOutputStream very very slow in 1.5.0_07.This may be the result of this. Could you test against the latest version of Java 6.0 available.
ndcostaa at 2007-7-14 19:17:07 > top of Java-index,Desktop,Runtime Environment...
# 2
Mustang solves the problem however we do not want to move to it as it is in beta stage
haimya at 2007-7-14 19:17:07 > top of Java-index,Desktop,Runtime Environment...
# 3
> JDK1.5.0_061.5.0_08 is already out. Have a look at its release notes (and those for 1.5.0_07, which are also in the same release notes link) to see if the ZipOutputStream bug has been fixed there..
shankar.unnia at 2007-7-14 19:17:07 > top of Java-index,Desktop,Runtime Environment...
# 4

Thank you all for your help but I found the problem

It is a bug in the JDK which is not fix in any 1.5 of 1.6 revisions

AFAIK it is not reported as a bug yet.

The problem is a combination of a JDK bug and a malformed jar that we have in our product.

For every jar in the class-path the compiler scans the manifest file and includes all the jars described there as well.

Unfortunately we have a jar named ri_generic.jar which its classpath includes ./ri_generic.jar

This puts the compiler into a loop which makes the class-path much longer (fortunately this is not an infinite loop)

The path created includes

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\.\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\.\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\.\.\.\.\ri_generic.jar

[javac] ***P:\BAC\BAC6.2_SP\Latest\dist\win32\Release\core\lib\.\.\.\.\.\.\.\ri_generic.jar

etc....

haimya at 2007-7-14 19:17:07 > top of Java-index,Desktop,Runtime Environment...