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

Forward only ResultSet doesn't release passed rows for GC

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 10.11.1.1
    • None
    • JDBC
    • MAC OSX 10.9.5
    • Normal
    • Repro attached
    • Deviation from standard

    Description

      I'd like to iterate over a ResultSet that is larger than the amount of memory available to my application. I thought this would be possible with a ResultSet.TYPE_FORWARD_ONLY but memory usage appears to increase as I loop through the results and not be GC'd. Is my understanding correct? I've tried this using the H2 database and it appears to do this.

      I've attached a sample program to illustrate this. It creates a large table then iterates over it logging out the memory usage as it goes. There is a pause at the end of the iteration to allow the user to attach a debugger (such as jvisualvm) to inspect memory usage and request GC.

      Attachments

        1. ResultSetTest.java
          5 kB
          Liam Sharp

        Activity

          People

            Unassigned Unassigned
            liam.sharp Liam Sharp
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: