MALLET is a Java-based package for statistical natural language processing, document classification, clustering, topic modeling, information extraction, and other machine learning applications to text.
Mallet bash wrapper script misses an option to set Java heap size like most other scripts.
Other scripts have something like:
# Default Java heap size. Change with -Xmx800m as the first argument.
mem=200m
# If first argument is something like -Xmx900m, process appropriately
arg=`echo "$1" | sed -e 's/-Xmx//'`
if test $1 != $arg ; then
mem=$arg
shift
fi
Another way to allow specifying memory would be:
# Set 1GB of memory if ${MALLET_MEMORY} is not defined
mem="${MALLET_MEMORY:-1g}"
# Run Mallet with 10GB of heap memory.
MALLET_MEMORY=10g ./bin/mallet
Mallet bash wrapper script misses an option to set Java heap size like most other scripts.
Other scripts have something like:
Another way to allow specifying memory would be: