Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4506928

Memory leak caused by java.awt.FileDialog

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.1_05
    • 1.4.0
    • client-libs
    • 05
    • x86
    • windows_2000



        Name: nt126004 Date: 09/25/2001


        java version "1.4.0-beta"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
        Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

        This bug occurs in HotSpot and Classic modes. It also appears in at least the
        following versions:



        Steps to reproduce:

        1. Create a java.awt.FileDialog.
        2. Show it.
        3. Close it.
        4. Garbage collect many times.

        The FileDialog is never garbage collected. It is being held by two JNI
        references. When these steps are repeated, additional FileDialog objects are
        leaked.

        The memory leak of the FileDialog object itself is not too severe, however it
        holds a reference to its parent Frame which is probably using much more memory.
        This leak was causing our application to leak several megabytes of heap per
        occurrence.

        I can provide you with a simple NetBeans project that demonstrates this leak
        and an OptimizeIt snapshot that shows the JNI references that are preventing
        garbage collection of the FileDialog objects and their parents.
        (Review ID: 132073)
        ======================================================================

              asultano Alex Sultanov
              nthompsosunw Nathanael Thompson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: