IBM Support

PK64874: HITTING OOM WHILE LOADING HUGE FILES IN JTEXTAREA.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Error Message: Hitting OOM while loading huge files in
    JTextArea.
    .
    Stack Trace: java.lang.OutOfMemoryError:
    
    at
    javax.swing.text.GapContent.allocateArray(GapContent.java:106)
    
    at javax.swing.text.GapVector.resize(GapVector.java:226)
    
    at javax.swing.text.GapVector.shiftEnd(GapVector.java:241)
    
    at javax.swing.text.GapContent.shiftEnd(GapContent.java:355)
    
    at javax.swing.text.GapVector.open(GapVector.java(Compiled
    Code))
    at javax.swing.text.GapVector.replace(GapVector.java(Compiled
    Code))
    at
    javax.swing.text.GapContent.insertString(GapContent.java(Inlined
    Compiled Code))
    at
    javax.swing.text.AbstractDocument.handleInsertString(AbstractDoc
    ument.java(Compiled Code))
    at
    javax.swing.text.AbstractDocument.insertString(AbstractDocument.
    java(Compiled Code))
    at
    javax.swing.text.PlainDocument.insertString(PlainDocument.java(C
    ompiled Code))
    at
    javax.swing.text.DefaultEditorKit.read(DefaultEditorKit.java(Com
    piled Code))
    at
    javax.swing.text.JTextComponent.read(JTextComponent.java:1350)
    
    at MyThread.readin(MyThread.java:81)
    at MyThread.run(MyThread.java:115)
    .
    No
    

Local fix

  • No
    

Problem summary

  • 1. Launch the application, select the option to load a file.
    2. Load a huge file of size 20MB into JTextArea. Once the file
    contents are observed, close the window.
    3. Repeat step 2 five or six times on a machine with 1G RAM and
    we should be able to observe the OutofMemory Error.
    

Problem conclusion

  • This defect will be fixed in:
    1.4.2 SR12
    .
    After investigating the issue we figured out the IBM 5.0 and
    onwards are behaving much better in comparison of IBM142. The
    reason of IBM 5.0 Java behaving better than IBM 142 Java is due
    to the storage array resize policy in GapContent class got
    changed in the earlier one.
    In IBM 142 Java the memory consumed by JTextArea appears to
    require 4 bytes per character. Although, 2 bytes is
    understandable in that as Java is unicode internally. But the
    extra 2 bytes was wastage of memory.
    5. So, under this defect we are backporting the 5.0 changes in
    the 142 codebase which was addressing the same issue i.e. high
    memory usage while loading huge files in JTextArea. By inclusion
    of this we can reduce the memory usage upto 50%.
    .
    To obtain the fix:
    Install build 20080713 or later
    

Temporary fix

Comments

APAR Information

  • APAR number

    PK64874

  • Reported component name

    JAVA(1.3/1.4 CO

  • Reported component ID

    5648C9800

  • Reported release

    42A

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2008-04-23

  • Closed date

    2008-07-21

  • Last modified date

    2008-07-21

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    JAVA(1.3/1.4 CO

  • Fixed component ID

    5648C9800

Applicable component levels

  • R42A PSN

       UP

  • R42L PSN

       UP

  • R42W PSN

       UP

  • R420 PSN

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SUPPORT","label":"IBM Worldwide Support"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.4.2","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
09 February 2022