Forums/Troubleshooting

Out of Memory Issue

Sean Tong
posted this on October 26, 2009 10:01 am

Overview:

The default setting of JVM should be: -Xmx1024m -XX:MaxPermSize=256m

If the server doesn't have enough memory, this setting should work too: -Xmx512m -XX:MaxPermSize=128m

Important: Memory is the key to better performance. The more the better. A typical rule is to allocate half of the available memory. So the 1024 example here would be for a server with 2G.

Keep in mind that 32bit systems won't allow you to allocate past 1.1 so even if you have 4G you'd still have to allocate 1024. (We recommend a 64bit server in any case)


Troubleshooting:

1. Out of Memory: Perm Gem Space

Solution: set the right XX:PermSize

 

2. Out of Memory: Heap Space

Possible causes:

a. Max Memory settings is too high. The server doesn't have enough memory for Java to use.

Solution: reduce the settings for -Xmx

b. Max Memory settings is too low. JVM runs out of memory.

Increase the settings for -Xmx

c. Big items in document. JVM trys to load these items into memory (e.g 100M+ item) and runs out of memory.

Solutions: remove these items with large size.

Query (MySQL):

select id, name, char_length(description) from document where char_length(description)

delete from evententry where document in (...);

delete from version where documentId in (...);

delete from document where id in (...);