The software DSpace relies on does not come out of the box optimized for large repositories. Here are some tips to make it all run faster.
Give Tomcat More Memory
Give Tomcat More Java Heap Memory
Performance tuning in Java basically boils down to memory. If you are seeing java.lang.OutOfMemoryError: Java heap space
errors, this is a sure sign that Tomcat isn't being provided with enough Heap Memory.
Tomcat is especially memory hungry, and will benefit from being given lots of RAM. To set the amount of memory available to tomcat edit $TOMCAT_HOME/bin/setclasspath.sh
and append a line likeTomcat, use either the JAVA_OPTS
or CATALINA_OPTS
environment variable, e.g:
Code Block |
---|
JAVA_OPTS=-Xmx512m -Xms512m
|
OR
Code Block |
---|
CATALINA_OPTS=-Xmx512m -Xms512m
|
The above example sets the maximum memory to 512MB.
Info | ||
---|---|---|
| ||
You can use either environment variable. |
If the machine is dedicated to DSpace a decent rule of thumb is to give tomcat half of the memory on your machine. At a minimum, you should give Tomcat >= 512MB of memory for normal DSpace operation. The latest guidance from Sun is to also set -Xms
to the same value as -Xmx
for server applications such as Tomcat.
Give Tomcat More Java PermGen Memory
If you are seeing java.lang.OutOfMemoryError: PermGen space
errors, this is a sure sign that Tomcat is running out PermGen Memory. (More info on PermGen Space: http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java)
To increase the amount of PermGen memory available to Tomcat (default=64MB), use either the JAVA_OPTS
or CATALINA_OPTS
environment variable, e.g:
Code Block |
---|
JAVA_OPTS=-XX:MaxPermSize=128MB
|
OR
Code Block |
---|
CATALINA_OPTS=-XX:MaxPermSize=128MB
|
The above example sets the maximum PermGen memory to 128MB.
Info | ||
---|---|---|
| ||
You can use either environment variable. |
At the time of writing, DSpace recommends you should give Tomcat >= 128MB of PermGen Space to ensure normal DSpace operation.
Note | ||
---|---|---|
Please note that you can obviously set both Tomcat's Heap space and PermGen Space together similar to:
|
Give the Command Line Tools More Memory
Give the Command Line Tools More Java Heap Memory
Similar to Tomcat, you may also need to give the DSpace Java-based command-line tools more memory. If you are seeing java.lang.OutOfMemoryError: Java heap space
errors, when running a command-line tool, this is a sure sign that it isn't being provided with enough Heap Memory.
By default, DSpace only provides 256MB of maximum heap memory to its command-line tools.
Wiki Markup |
---|
If you'd like to provide *more* memory to command-line tools, you can do so via the {{JAVA_OPTS}} environment variable (which is used by the {{\[dspace\]/bin/dspace}} script). Again, it's the same syntax as above: |
Code Block |
---|
JAVA_OPTS=-Xmx512m -Xms512m
|
This is especially Edit the -Xmx
argument on the last line of $DSPACE_HOME/bin/dsrun
to increase the memory available to command line tools. Especially useful for big batch jobs.
...