Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-2480

DriverManager.getConnection leaks memory when connecting to a non-existent database

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
    • 10.3.1.4
    • JDBC
    • None
    • Windows Vista, JDK 1.4.2_13
      Solaris 10, Sun JDK 1.4.2, 1.5.0 & 1.6.0
      Red Hat Enterprise Linux 4 (2.6.9-34.ELsmp_64), Sun JDK 1.5.0 & 1.6.0

    Description

      Repeated calls to java.sql.DriverManager.getConnection("jdbc:derby:C:
      DOES_NOT_EXIST") leak memory and eventually lead to an OutOfMemoryError.

      This bug is similar to DERBY-1947 in that ContextManager objects are not getting removed from the HashSet. The attached test program demonstrates the issue. When run with VM options -Xms8m -Xmx8m, it throws an OutOfMemoryError after 19022 calls to DriverManager.getConnection.

      Attachments

        1. testOpenOfMissingDatabase.java
          1 kB
          Jeff Clary
        2. heap-server-Xmx32m.png
          86 kB
          John Embretsen
        3. Patch_DERBY-1947_and_DERBY-2480.diff
          2 kB
          Jeff Clary
        4. DERBY-2480-1.diff
          0.5 kB
          Jeff Clary
        5. derbyall_report.txt
          5 kB
          Jeff Clary
        6. d2480-junitTest_v1.diff
          16 kB
          John Embretsen
        7. d2480-junitTest_v1.stat
          0.3 kB
          John Embretsen

        Issue Links

          Activity

            People

              johnemb John Embretsen
              clary2137 Jeff Clary
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: