powered by Jive Software

Memory leak in Openfire 4.4.4

Hallo,

I have another evidence of memory leaks in OF 4.4.4 (please see attachments) to support another finding mentioned here by suf126a.

Loadtest:
OS: Solaris 10 sparc
JDK: 1.8.0_191
50 concurrent users
5 chatrooms

The memory leak appears specifically when sending attachments (file transfers). A large number of FileTransfer objects appear to be kept in memory. A large number of DomainPairs also seem to exist (I 'll send screenshots in the near future).

StanzaHandler.processIQ() calls MetaFileTransferInterceptor.interceptPacket() for each IQ it processes (see profiler screenshot) which calls:

FileTransfer transfer = createFileTransfer(from, to, childElement);
and
acceptIncomingFileTransferRequest(transfer)

These file transfers seem to be cached in method acceptIncomingFileTransferRequest(transfer):
cacheFileTransfer(ProxyConnectionManager.createDigest(streamID, from, to), transfer)
and Cache seems to work fine (it autocleans itself after a while).

So, I wonder who keeps references to these FileTransfer objects.

FileTransfer references escape only via retrieveFileTransfer() method but this is called by DefaultFileTransferManager.registerProxyTransfer() and cached again.

I hope further discussion to the topic will help find the problem.

openfirememoryleak.zip (309.3 KB)

Kind regards,

John

1 Like

Interesting. Can you provide a memory dump that contains the instances that are leaking? I’d like to find out what keeps references to them open.

I 'm afraid I won’t be able to provide you with a heap dump (I tried a number of things but it won’t be possible to take it out of our system). So, I 'm afraid we have to continue with screenshots.

attachments(1).zip (257.8 KB)

If these won’t help, I can provide more later.

Thanks.