PEP service memory leak


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.




Guus der Kinderen


Guus der Kinderen