OutOfMemory or slowdown due to http response compression

[] [] [] [] [] [] [] [] [] [] [] [] []

Symptom
OutOfMemoryError occurs if the system is under load and http responses are being compressed.System response times are instable on constant load if http responses are being compressed.Performance degrades in time if http responses are being compressedExporting BI reports to excel is slow and the majority of the time is consumed in java.util.zip.Deflater.deflate()Other terms

OutOfMemory, OutOfMemoryError, j2ee, compression, zipping, Deflater, GZipOutputStreamImplementation, EnableZippedResponse, scalability, crash, jazzlib
Reason and Prerequisites

There are scalability issues in the Deflater implementation of Sun and HP JDK versions 1.3.1.x and 1.4.x. from Sun.
The native library which implements the zipping functionality does not distribute the CPU load evenly and also accumulates the consumed memory over time which under high load leads to OutOfMemoryError.
Although the OutOfMemoryError can much harder be reproduced on 1.4.x compared to 1.3.1.x, the scalability and performance degradation are present in both JDK versions. The OutOfMemoryError problem has not been detected with the latest JVM from Sun (from 1.4.2_12 onwards).
So far tests have been performed only with Sun and HP JVMs but the bug possibly exists in other JVM implementations which have licensed code from Sun.
Therefore since PL23 of the J2EE Engine 6.20 and SP8 of J2EE Engine 6.40 the implementation of the zipping routine is pluggable.
Since SP 24 of SAP J2EE Engine 6.40 a workaround has been implemented in the Engine kernel that avoids a bug in java.util.zip.Deflater.
By implementing striding of the input as a workaround for the usage of the deflater the scalability and memory issues are prevented. The same workaround is used also in the standard java.util.zip.GZIPOutputStream class from the JDK.
If you have previously applied this note to integrate a third party zipping library in order to workaround the problems above, since SP24 of the Engine you can remove the third party library as described in Note 1363755.

Solution

I.For SAP J2EE Engine 6.40/7.0you need to:
1. Make sure you are using the latest 1.4.2 JDK version
2. Upgrade the Engine to
for SAP J2EE Engine 6.40 to SP 24 or higherfor SAP J2EE Engine 7.00 to SP 19 or higherfor SAP J2EE Engine 7.01 to SP 04 or higherfor SAP J2EE Engine 7.02 it is not necessary to upgrade
3. If the problem is still not resolved you can do either
Switch off zipping of http responses as described in Note 1261901 (at the cost of increased communication overhead)Use third party zipping library as described in Notes 1363710, 1363755

II.For SAP J2EE Engine 6.20you can do either:
Switch off zipping of http responses as described in Note 1261901 (at the cost of increased communication overhead)Use third party zipping library as described in Notes 1363710, 1363755

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Comment