server does not clean up session handlers
Brought to you by:
marcel_may,
waelc
We are using greenmail within Alfresco and have seen some memory usage that do not seem to be as efficient as possible. With each connection and synchronisation of the email client, the base heap memory consumption of the repository increases, despite the client being disconnected / logged out properly.
If needed we can provide a neutral heap dump for analysis. When looking at the "shortest path to GC root" we can see that 46 instances of com.icegreen.greenmail.imap.ImapHandler (80 MiB of retained memory) are kept in memory by deactivated handlers referenced from the ImapServer.
Attached is a patch generated from a previously patched version of greenmail. Applying this patch resolves the issue for our test case.
Thanks alot!
Fixed in https://github.com/greenmail-mail-test/greenmail/issues/18 and will be included in upcoming release 1.4