JDK-5053393 : OutOfMemory is thrown when chunk length is equal to (-1)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-05-26
  • Updated: 2004-06-08
  • Resolved: 2004-06-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b55Fixed
Related Reports
Relates :  
Description

Name: vpR10197			Date: 05/26/2004


--------------------------------------                                                                                   
Test        : http/HttpStreaming/Chunked/chunked006
VM          : ClientVM, ServerVM
Mode        : all
Platform    : all
OS          : all
JDK         : since tiger-b50
----------------------------------------                                                                                 
The test checks up HttpURLConnection.setChunkedStreamingMode() method for
a case when the chunk length is equal to -1. According to the specification
'a default value' must be used. But OutOfMemory is thrown when large amount
of bytes is being posted.
I tried this test on different boxes, but every time the test catches
OutOfMemory after posting (approximately) 32 MB
Note when chunklen is not equal -1, but it is less than or equal to zero,
the test works properly.

To reproduce the failure:
   cd /net/jano.sfbay/export/disk20/GammaBase/Bugs/<this bug number>
   sh run.sh $JAVA_HOME [-g] [JAVA_OPTS]
where
     -g  - run test with java_g binaries

Here is an example of test's output:
    Settings:
            totalBytes = 100M
            bufferSize = 4M
    HTTP-client>Starting default Http-server
    waiting server to be start
    assigning -1 to the chunk length
    Server started
    sending 104857600 bytes
    4194304 was sent
    8388608 was sent
    12582912 was sent
    16777216 was sent
    20971520 was sent
    25165824 was sent
    29360128 was sent
    33554432 was sent
    java.lang.OutOfMemoryError: Java heap space
    ***ERR***> UNEXPECTED error: java.lang.OutOfMemoryError: Java heap space
    TEST FAILED
    Java exit code: 97

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic tiger-rc FIXED IN: tiger-rc INTEGRATED IN: tiger-b55 tiger-rc
08-07-2004

EVALUATION Will fix for Tiger-rc. ###@###.### 2004-05-26
26-05-2004