[
https://issues.apache.org/jira/browse/JAMES-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Karsten Otto resolved JAMES-3799.
---------------------------------
Resolution: Fixed
> 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
> Priority: Major
> Time Spent: 3h 40m
> Remaining Estimate: 0h
>
> 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: [email protected]
For additional commands, e-mail: [email protected]