Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Choosing the size of memory spaces allocated to DSpace

...

Tomcat is especially memory hungry, and will benefit from being given lots of RAM. To set the amount of memory available to Tomcat, use either the JAVA_OPTS or CATALINA_OPTS environment variable, e.g:

Code Block
    CATALINA_OPTS=-Xmx512m -Xms512m

OR

Code Block
    JAVA_OPTS=-Xmx512m -Xms512m

...

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
    CATALINA_OPTS=-XX:MaxPermSize=128m

OR

Code Block
    JAVA_OPTS=-XX:MaxPermSize=128m

...

Note

On an Ubuntu machine (10.04) at least, the file /etc/default/tomcat6 appears to be the best place to put these environmental variables.

Choosing the size of memory spaces allocated to DSpace

psi-probe is a webapp that can be deployed in DSpace and be used to watch memory usage of the other webapps deployed in the same instance of Tomcat (in our case, the DSpace webapps).

  1. Download the latest version of psi-probe from https://code.google.com/p/psi-probe/
  2. Unzip probe.war into [dspace]/webapps/

    Code Block
    cd [dspace]/webapps/
    wget https://psi-probe.googlecode.com/files/probe-2.3.3.zip
    unzip probe-2.3.3.zip
    unzip probe.war -d probe
  3. Add a Context element in Tomcat's configuration ( in  or in ) and make it privileged (so that it can monitor the other webapps):
    EITHER in $CATALINA_HOME/conf/server.xml

    Code Block
    languagexml
    <Context docBase="[dspace]/webapps/probe" privileged="true" path="/probe" />

    OR in $CATALINA_HOME/conf/Catalina/localhost/probe.xml

    Code Block
    languagexml
    <Context docBase="[dspace]/webapps/probe" privileged="true" />
  4. Edit $CATALINA_HOME/conf/tomcat-users.xml to add a user for loggin into psi-probe (see more in https://code.google.com/p/psi-probe/wiki/InstallationApacheTomcat#Security)

    Code Block
    <tomcat-users>
      <user username="admin" password="t0psecret" roles="manager" />
    </tomcat-users>
  5. Restart Tomcat
  6. Open http://yourdspace.com:8080/probe/ (edit domain and port number as necessary) in your browser and use the username and password from tomcat-users.xml to log in.

In the "System Information" tab, go to the "Memory utilization" menu. Note how much memory Tomcat is using upon startup and use a slightly higher value than that for the -Xms parameter (initial Java heap size). Watch how big the various memory spaces get over time (hours or days), as you run various common DSpace tasks that put load on memory, including indexing, reindexing, importing items into the oai index etc. These maximum values will determine the -Xmx parameter (maximum Java heap size). Watching PS Perm Gen grow over time will let you choose the value for the -XX:MaxPermSize parameter.

Give the Command Line Tools More Memory

...

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

...

If you'd like to provide more PermGen Space 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=-XX:MaxPermSize=128m

...