Karsten Otto created JAMES-3799: ----------------------------------- Summary: Optimize memory requirements of SimpleMessageSearchIndex Key: JAMES-3799 URL: https://issues.apache.org/jira/browse/JAMES-3799 Project: James Server Issue Type: Improvement Components: MailStore & MailRepository Affects Versions: master Reporter: Karsten Otto
While experimenting some more with the ExpireMailboxService, I noticed that it uses an unexpectedly high amount of heap memory. I tracked the issue down to SimpleMessageSearchIndex.searchResults(), which always uses FetchType.FULL when retrieving messages from the MessageMapper for non-UID searches. Thus it loads the entire mail into memory, even if it only needs to check the internalDate. I propose to optimize the fetch type used at this point, so it depends on the actual requirements of the stated SearchQuery. For most queries, it will only need to retrieve the mail headers, which typically have a much smaller memory footprint than mail bodies. For certain cases it may avoid even that if it only needs the message metadata. Besides a significant reduction in memory use, I also anticipate a certain amount of speed improvement when reducing/skipping content retrieval from blob storage. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org