PEP service memory leak

Description

As described by Andre:
Running Openfire service for a long time, with clients connecting and disconnecting, I realized that the memory was increasing up to the point the garbage collector could not do anything more to release memory (the CPU load was on top!).

I got a dump and analysed in JProfile and saw that the object EntityCapabilitiesManager.allUserCapabilitiesListeners was with about 7000 listeners. The instance of this listeners was PEPService.

Looking more deeply in code, I saw the PEPService are created/loadedFromDB and inserted in PEPServiceManager.pepServices cache. In the creation/loadFromDB the call pubSubEngine.start(pepService) inserts the PEPService in the EntityCapabilitiesManager.allUserCapabilitiesListeners.

However, the PEPService is evicted from cache every 30 minutes, but it still remains in EntityCapabilitiesManager. In the next call of PEPServiceManager.getPEPService() another instance of PEPService is inserted in EntityCapabilitiesManager.allUserCapabilitiesListeners for the same user.

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Ignite Forum URL

Components

Fix versions

Affects versions

Priority

Created October 2, 2020 at 5:59 PM
Updated October 28, 2020 at 1:26 PM
Resolved October 15, 2020 at 7:37 PM