Memory leak due to dangling references to discarded DB requests
Multiple references to discarded DB queries were found in bound objects. A new method removeDiscardedReally
was added into query garbage collector. This makes sure that the parent sets of bound queries are purged from discarded entries. This is difficult to ensure otherwise since the parents can get discarded by completely different query. removeDiscardedReally
potentially spends a lot of effort in going through entries that are still alive and may present a possible performance issue. On the other hand query garbage collector is not continuous so that collection rounds are only triggered when enough query activity is recorded. This means that even removeDiscardedReally
does not ensure that all trash gets collected when the system is idle. Calling QueryCollector.flush
performs a single walk-through and that should be enough to get rid of all parent trash.