Derby
  1. Derby
  2. DERBY-5267

Shut down engine for old versions in upgrade tests to save memory

    Details

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

      Description

      The memory requirements for the upgrade tests seem to go up each time we add a new release. Lately, they've started failing on phoneME with the error message saying "Number of class names exceeds vm limit." It looks to me as if the problem is that we don't shut down the engine when we've finished testing a version, so we eventually end up with 19 different versions of the engine loaded in the same process. I think it would be good to shut down the old engines when we're done with them to free up resources.

      1. shutdown-engine.diff
        2 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Hide
          Knut Anders Hatlen added a comment -

          Committed revision 1135432.

          Show
          Knut Anders Hatlen added a comment - Committed revision 1135432.
          Hide
          Knut Anders Hatlen added a comment -

          The attached patch makes PhaseChanger shut down the engine, instead of shutting down each database individually, at the end of each phase. This made the upgrade test run again on phoneME in my environment.

          I had hoped that a change like this would reduce the memory usage on Java SE too, but that doesn't seem to be the case, because the old versions of the driver (and thereby all the engine classes) is still referenced from the DriverManager. (There's no DriverManager in JSR-169, that's why it's not a problem on phoneME.) It might possibly be solved by deregistering the driver manually, but there's some trickiness involved because of the upgrade tests' use of special class loaders to load the old Derby versions and DriverManager not allowing the deregistering of drivers registered in other class loaders, so I'm not addressing that issue right now.

          Show
          Knut Anders Hatlen added a comment - The attached patch makes PhaseChanger shut down the engine, instead of shutting down each database individually, at the end of each phase. This made the upgrade test run again on phoneME in my environment. I had hoped that a change like this would reduce the memory usage on Java SE too, but that doesn't seem to be the case, because the old versions of the driver (and thereby all the engine classes) is still referenced from the DriverManager. (There's no DriverManager in JSR-169, that's why it's not a problem on phoneME.) It might possibly be solved by deregistering the driver manually, but there's some trickiness involved because of the upgrade tests' use of special class loaders to load the old Derby versions and DriverManager not allowing the deregistering of drivers registered in other class loaders, so I'm not addressing that issue right now.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development