The default setting for tomcat heap allocation in IV is 2GB. Some operations, such as uploading large files with base64 encoding, or installing or adapting large models, require more heap allocation
Checking the max heap allocation
First find the process id of the java process. This command will show the process id and command of all processes belonging to tomcat 8 user
sudo ps -u tomcat8 -o pid,args
The output looks like this, in this case the process id of the java command is 817:
PID COMMAND
817 /usr/lib/jvm/java-1.8.0/bin/java -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=t
11782 audiowaveform --input-format wav -o /opt/tomcat/temp/1658498257196-0/original-recording.json -b 8
Then use the jinfo command to find the setting MaxHeapSize:
sudo jinfo 817|grep MaxHeapSize
The output looks like this, in this case the MaxHeapSize is set to 4294967296 or 4GB:
Non-default VM flags: -XX:CICompilerCount=4 -XX:InitialHeapSize=1073741824 -XX:MaxHeapSize=4294967296 -XX:MaxNewSize=697892864 -XX:MaxTenuringThreshold=6 -XX:MinHeapDeltaBytes=196608 -XX:NewSize=697892864 -XX:OldPLABSize=16 -XX:OldSize=375848960 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
Increasing the max heap allocation
To increase the heap allocation to 4GB, create or modify the file setenv.sh in /opt/apache-tomcat-*/bin/ and add this line at the end:
JAVA_OPTS="$JAVA_OPTS -Xmx4096m"
And then restart tomcat