Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1364

InMemorySessionFactory has apparent memory leak

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 6.5.0.Final
    • core engine
    • None
    • Hide

      Build a runtime manager with per-request and session caching enabled.
      repeatedly get a runtime, get its session, run some rules (making sure at least some fire), and then release the runtime. Do this maybe 100,000 times. Helps if you do this with multiple threads and rapidly so that the runtimemanager has to create a good number of concurrent sessions.

      Notice lots of RightTuple objects and session objects hanging off the sessionfactory

      Show
      Build a runtime manager with per-request and session caching enabled. repeatedly get a runtime, get its session, run some rules (making sure at least some fire), and then release the runtime. Do this maybe 100,000 times. Helps if you do this with multiple threads and rapidly so that the runtimemanager has to create a good number of concurrent sessions. Notice lots of RightTuple objects and session objects hanging off the sessionfactory
    • NEW
    • NEW

      I'm running drools with a runtime manager creating using PerRequest strategy and SessionCache turned on. (I process a LOT of requests but I want each one to be isolated)

      The SessionCache properly gets rid of sessions that have hung around too long, which is great.

      But the InMemorySessionFactory keeps a copy of every session it ever created, which – it seems to me – impedes garbage collection of unneeded, old sessions.

      It's possible I'm just reading this wrong, but examinations of running code using VisualVM show a LOT of RightTuple objects hanging around, attached to sessions and their GC root appears to be the InMemorySessionFactory.

              swiderski.maciej Maciej Swiderski (Inactive)
              eliasisrael_jira Eli Israel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: