Jerry M ha scritto:
Thanks Stefano,

Are you saying that James stores in memory a key for every email found for every user in the entire mail db? Wow... I have to keep the 'spam' messages around a while (several days at least) for my users to give them time to check for messages incorrectly flagged as spam. I only have a couple of hundred users. But with the current spam rate, my inbox table has 175,000 records in it, even with pruning spam records after a few days. James is storing 175,000 keys in memory for this? I'm sure there's a reason for that. But it does seem like it's destined for hitting a memory heap limit sooner or later. Is there any way to turn that off? How do JAMES installations with thousands of users handle the memory problem?

Unfortunately I only use JAMES in high traffic smtp server but with very limited number of users (<100) so I never investigated issues with many users.

The keys collection is loaded in memory when a "MailRepository.list" method is called (for both db and file implementation). This is called at least for POP3 connections.

For file based repositories, instead, the AvalonMailRepository implementation manage a cache.
I know there is a way to disable the cache:
         <!-- in the file system. -->
<repository class="org.apache.james.mailrepository.AvalonMailRepository">
            <protocols>
               <protocol>file</protocol>
            </protocols>
            <types>
               <type>MAIL</type>
            </types>
<!-- Set if the messages should be listed sorted. False by default -->
            <config FIFO="false"/>
         </repository>

try to add a CACHEKEYS="false" to the config element.

Anyway the full key list will be loaded once in memory at initialize time (and then disposed) and each time a list is called (and then trashed by the garbage collector).
The cachekeys=false simply avoid having the full list permanently in memory.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to