Uploaded image for project: 'Hibernate ORM'
  1. HHH-12509

Reduce memory usage of PreparedStatementSpyConnectionProvider

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.17, 5.3.0.CR2
    • Component/s: testsuite
    • Labels:
      None
    • Last commented by a user?:
      true
    • Sprint:

      Description

      The memory usage has increased considerably after recent progress, to the point that the PostgreSQL specific suite is running in out of memory with the current heap settings.

      Heap analysis shows that the main consumer is Mockito as we "spy" on many JDBC Connections, this is causing internal objects of Mockito to be allocated for each interaction with a Connection or any Statement. The testsuite performs a significant amount of invocations on these so the combination gets us above 4GB of memory usage.

      I'm still investigating the Mockito internals to understand if this is by design or a leak, but in the meantime I've found some flags which we can apply to reduce this memory consumption, at the drawback of not being able to perform a "verification" on mock invocations.

      It turns out that some tests need such verification, but to be safe I'm disabling this flag globally and allowing it to be enabled only explicitly. Not ideal as new tests will need to consider this limitation, but hopefully in the meantime I can figure out a proper fix for Mockito.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                sanne Sanne Grinovero
                Reporter:
                sanne Sanne Grinovero
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: