Skip to content
Cheng Li edited this page Oct 4, 2016 · 5 revisions

How to increase the Java application heap size (memory)?

The default heap size (10G) in Pyramid may not be big enough if you have a large dataset with many instances or features. To increase the heap size, open the pyramid script with a text editor, and modify the numbers after -Xms and -Xmx. For example, if you want to start with 5G of memory and allocate up to 50G, you can set -Xms5g -Xmx50g.

As a side note, if the dataset feature matrix contains many zeros, using the sparse matrix format can often reduce memory usage significantly.

How to control the number of threads used?

By default, Pyramid performs multi-threading and uses all available cores. To manually specify the number of threads Pyramid uses, open the pyramid script with a text editor, and add -Djava.util.concurrent.ForkJoinPool.common.parallelism=N to JAVA_OPTS, where N is the desired number of threads.

Clone this wiki locally