Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Discovery Commons 1.0.20
Description
As identified in volteanu's adaptTo presentation, it seems that Sling Discovery on Oak is consuming 42MB of RAM on a standard instance.
Sling discovery deals with transient states (the views, leases, etc.) and is not caching significant amount of data. The 42MB figure for the discovery feature seems like a symptom of a memory leak.
volteanu shared in his presentation that the 42MB worth of RAM was mainly consumed by a Json Factory reference. There is one static JsonReaderFactory in the discovery commons module, in the DiscoveryLiteDescriptor.
Looking at the code, it seems that each invocation of the getDescriptorFrom method creates a JSON reader but never close it. This may may leave resources behind as hinted by the description of the close method in the API. AFAIK, the getDescriptorFrom is invoked periodically on a relatively high frequency (< seconds) which may be the trigger for the leak on all instances.
This is only a supposition for now, it should be investigated further, simply by running a patched version of org.apache.sling.discovery.commons that make sure each JSON reader is properly closed.
Attachments
Attachments
Issue Links
- is related to
-
SLING-8232 Wrap the latest release of johnzon-core
- Resolved
- relates to
-
JOHNZON-134 performance regression due to releaseFallBackCopyBufferLength
- Closed
-
JOHNZON-125 Support any buffer size and avoid memory issues with small allocations
- Resolved