1. Derby
  2. DERBY-5472

Speed up MemoryLeakFixesTest.testRepeatedDatabaseCreationWithAutoStats()


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s:
    • Fix Version/s:
    • Component/s: Test
    • Labels:


      MemoryLeakFixesTest.testRepeatedDatabaseCreationWithAutoStats() takes fairly long time. When I run it with -Xmx16M (per instructions in the comments) in my environment, that test case alone takes 80-90 seconds. And it runs twice (embedded and client) so it takes nearly 3 minutes in total.

      There are ways to speed it up and still have it expose DERBY-5336, for which it was originally written:

      1) The body of the test is executed 50 times. When the fix for DERBY-5336 is backed out, the test case typically fails in the 8th or 9th iteration, so 20 iterations should be enough.

      2) In each iteration, a table with 500 rows is created. Since the goal is to get the istat daemon to run, we only need to insert enough rows to exceed, which is 100 by default. Reducing the size to for example 200 rows would be OK.

      3) When populating the table, a select statement is compiled and executed in between each insert statement. To get the istat daemon running, it's sufficient to execute a single select statement once the table is populated.

      4) Every insert statement is compiled separately. Would be better to compile once and execute multiple times.

      5) Populating the table could happen with auto-commit off.

      1. d5472.diff
        4 kB
        Knut Anders Hatlen
      2. d5472-phoneme.diff
        1 kB
        Knut Anders Hatlen

        Issue Links


          Knut Anders Hatlen created issue -
          Knut Anders Hatlen made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          Knut Anders Hatlen made changes -
          Attachment d5472.diff [ 12499682 ]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-5336 [ DERBY-5336 ]
          Knut Anders Hatlen made changes -
          Issue & fix info Patch Available [ 10102 ]
          Knut Anders Hatlen made changes -
          Fix Version/s [ 12316344 ]
          Issue & fix info Patch Available [ 10102 ]
          Priority Major [ 3 ] Minor [ 4 ]
          Knut Anders Hatlen made changes -
          Attachment d5472-phoneme.diff [ 12499826 ]
          Knut Anders Hatlen made changes -
          Status In Progress [ 3 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Gavin made changes -
          Workflow jira [ 12638363 ] Default workflow, editable Closed status [ 12796666 ]


            • Assignee:
              Knut Anders Hatlen
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: