Out of Memory
If you are running more than around 500 mailboxes, it is essential to increase the amount of RAM allocated to the email archive server. To cope with the traffic passing through the journal account, you will also need to increase the number of email archiving threads in the General tab.
What Happens When The Server Runs Out Of Memory
If the email archiving server runs out of memory, unpredictable results can occur, such as the server will stop archiving emails or the system will exit
entirely. When the exception occurs, 9/10 it will be reported in the mailarchiva_debug.log file.
OutOfMemory Error Likely Causes
There are two possible causes for the error:
- not enough heap space is allocated (java.lang.OutOfMemoryError: Heap space)
- not enough perm gen space (java.lang.OutOfMemoryError: Permgen space)
In the first instance, there may be a large volume of email archive traffic being processed by the server causing the email archiving server to allocate a large number of objects on the heap. In the second instance,
MailArchiva's code base has grown larger than the amount of memory allocated to it.
Under normal operation (500 mailboxes):
MailArchiva consumes about 512 MB of heap space (with both email archiving and multiple user's searching) and 96 MB of perm space.Although, we strongly recommend allocating 768M heap and 128M for safety sake.
Note: In high volume environments, your server will require more memory than usual.
Solutions To OutOfMemory Error
Upgrade Your Email Archive Software To Latest Version
There is a known long term archiving memory leak in server's earlier than v1_9_6. Visit
http://www.mailarchiva.com/downloads.
Increase The Amount of Memory
To increase the amount of memory allocated to the email archive server:
on Windows: right click task tray applet, click Configure..., select Java tab, enter 1512m for the maximum memory size.
On Linux: edit file /usr/local/mailarchiva/server/startserver.sh
Go to the line:
export CATALINA_OPTS="-Xmx768m -Xms256m -XX:PermSize=128M -XX:MaxPermSize=128M"
replace -Xmx768m with a higher value, such as -Xmx1960m (heap space)
maximum amount of memory (32 bit restrictions)
Linux 32-bit: ~1960mb
Windows 32 bit: ~1.5gb
See:
http://java.sun.com/docs/hotspot/HotSpotFAQ.html#gc_heap_32bit
If you are running a large email archiving server installation with 2000 mailboxes or more, you may need to install a 64 bit operating system such as Windows Server 64 bit or Ubuntu Server 64 bit. On a 64-bit operating system you will be able to allocate more memory to the server (as described above) and take full advantage of your physical RAM limits.
Please note: when you upgrade your email archive server from one version to another, you heap size settings may revert back to the defaults. Please
check that your heap size settings are correct after each upgrade.
As of v1.9.5, the Enterprise Edition for Windows and Linux incorporate both a 32bit and a 64bit JVM. It will automatically detect the appropriate JVM based on the architecture of your operating system.
Decrease No. Archiving Threads
By default
MailArchiva will archive ten emails simultanously. If your email archive server is running out of memory, one solution is to decrease the number of archiving threads to ease the memory consumption requirements of the server. You can do this by editing the number of archiving threads in the General tab.
Do Less Things Simultaneously
Don't attempt to reindex a volume while the email archiver is archiving emails heavily. Rather, disable the journal account and reindex over night.
--
JamieBand - 31 Mar 2009