Apache Cassandra 1.1 Documentation

Configuring the heap dump directory

This document corresponds to an earlier product version. Make sure you are using the version that corresponds to your version.

Latest Cassandra documentation | Earlier Cassandra documentation

Cassandra starts Java with the option -XX:-HeapDumpOnOutOfMemoryError. Using this option triggers a heap dump in the event of an out-of-memory condition. The heap dump file consists of references to objects that cause the heap to overflow. Analyzing the heap dump file can help troubleshoot memory problems. By default, Cassandra puts the file a subdirectory of the working, root directory when running as a service. If Cassandra does not have write permission to the root directory, the heap dump fails. If the root directory is too small to accommodate the heap dump, the server crashes.

For a heap dump to succeed and to prevent crashes, configure a heap dump directory that meets these requirements:

  • Accessible to Cassandra for writing
  • Large enough to accommodate a heap dump

Base the size of the directory on the value of the Java -mx option.

To configure the heap dump directory:

  1. Open the cassandra-env.sh file for editing. This file is located in:

    • Packaged installs


    • Binary installs


  2. Scroll down to the comment about the heap dump path:

    # set jvm HeapDumpPath with CASSANDRA_HEAPDUMP_DIR
  3. On the line after the comment, set the CASSANDRA_HEAPDUMP_DIR to the path you want to use:

    # set jvm HeapDumpPath with CASSANDRA_HEAPDUMP_DIR
  4. Save the cassandra-env.sh file and restart DataStax Enterprise.