Task #9456 (closed)
Bug: stateful service memory leak
Reported by: | cxallan | Owned by: | jamoore |
---|---|---|---|
Priority: | blocker | Milestone: | OMERO-4.4.4 |
Component: | Performance | Version: | n.a. |
Keywords: | n.a. | Cc: | omero-team@… |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | 2012-08-14 (2) |
Description
In the pursuit of the closure of #9330, a subtle bug has been introduced where when a session's client reference count is at zero (near 99% of the time when used in conjunction with OMERO.web and the new decorator infrastructure which joins and closes sessions on each remote method call) the handler for DestroySessionMessage events does not remove the remaining stateful services from the object adapters resulting in a comparatively small memory leak.
The above is made significantly worse if cached rendering engines are used and even more catastrophic if those cached rendering engines contain instances of BfPixelBuffer or BfPyramidPixelBuffer. Both of which could occupy 10's of MBs of RAM.
Change History (7)
comment:1 Changed 12 years ago by cxallan
- Cc omero-team@… added
- Owner set to cxallan
- Status changed from new to accepted
comment:2 Changed 12 years ago by jmoore
- Owner changed from cxallan to jmoore
comment:3 Changed 12 years ago by jmoore
comment:4 Changed 12 years ago by jmoore
- Remaining Time changed from 1.0 to 0
- Resolution set to fixed
- Status changed from accepted to closed
comment:5 Changed 12 years ago by Chris Allan <callan@…>
(In [2b1bb13372ec51107d9e9a4f6b98376bf3847375/ome.git] on branch develop) Potential solution for leaking stateful services. (See #9456)
comment:6 Changed 12 years ago by jmoore <josh@…>
(In [a4549547d5d766e17fda30b72a979d0102914448/ome.git] on branch develop) Refactor cleanup using statics (See #9456)
Initially, I tried to make use of a temporary SessionI instance in order
to re-use the cleanServants method. But since the session is timed out,
much of the ctor logic cannot be re-used. Instead, I've moved the
content of the methods to re-usable static versions.
comment:7 Changed 12 years ago by jmoore <josh@…>
(In [36004a8eb71ef4f915126a3348c20da0d6a88197/ome.git] on branch develop) Pass ServantHolder? to AbstractAmdServants? (See #9456)
Without a valid clientId, it wasn't possible to find the
ServiceFactoryI instance which owned the servant on close.
By passing in the ServantHolder?, we can cleanly clean up
using the static methods from the previous commit.
After refactoring and a couple of minor fixes, I'm seeing this output: