mimno / Mallet

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.
https://mimno.github.io/Mallet/
Other
984 stars 344 forks source link

mallet bash wrapper script misses an option to set Java heap size like most other scripts. #196

Closed ghuls closed 3 years ago

ghuls commented 3 years ago

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
mimno commented 3 years ago

I've added the $MALLET_MEMORY version, thanks!

ghuls commented 3 years ago

Thanks. To be consistent, the other scripts probably should use something similar.