Hello,
unfortunately, I don't see any configuration options that would relate to memory tuning of the IMAPServer.
Just out of curiosity and in order to help identify the root cause: Would it be possible to provide a heap dump (e.g. via the Alfresco Cloud) for distributed analysis? Before answering to hastily, please bear in mind that it may be possible to extract some potentially sensitive information from the dump (usually not passwords, but content of emails e.g.).
Since MAT has identified these instances / classes as a potential memory leak, you need to identify what holds them in memory (why your GCs do not remove them). Usually, the identified elements are just the symptom / largest affected elements of a leak, but not the leak itself. This involves analysing the "Paths to GC Roots" for those 500 elements.
Regards
Axel