Thanks again @vmassol.
Answering your questions in the order.
- I’ve tried with 4GB max JVM memory to import 1GB and 2GB files.
- Tried with 17Mb XAR file and the import is fine.
Got the JVM memory details.
Tomcat Instance 1: Trying import on this instance.
Current size of heap in bytes: 1073741824
Maximum size of heap in bytes. 1073741824
Amount of free memory within the heap in bytes: 674365448
Tomcat Instance 2:
Current size of heap in bytes: 4479516672
Maximum size of heap in bytes. 32178700288
Amount of free memory within the heap in bytes: 2765465000
Instance 1 memory config in systemd:
Environment='JAVA_OPTS='-Xmx4096m -Xms4096m'
Environment='CATALINA_OPTS=-Xms4096m -Xmx4096m -XX:MaxPermSize=4096m -server -XX:+UseParallelGC -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true'
Instance 2 memory config in systemd:
Environment='JAVA_OPTS='-Xmx4096m -Xms4096m'
Environment='CATALINA_OPTS=-Xms4096m -Xmx4096m -XX:MaxPermSize=4096m -server -XX:+UseParallelGC -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true'
So, Instance2 is taking max memory as ~4GB but Instance1 is taking max memory as ~1GB.
Hence, this is the root cause for the JVM OOM error.