-1

Inside my webapplication, for every 5 minutes I am running bash scripts scheduled under crontabs.

And my script looks this way

cd /opt/glassfish4/glassfish/domains/domain1/applications/TradeOnlineChat/WEB-INF/classes/
JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
$JAVA_HOME/bin/java -Dlog4j.configuration=file:/opt/glassfish4/glassfish/domains/domain1/applications/TradeOnlineChat/WEB-INF/classes/log4j.properties -cp .:/opt/glassfish4/glassfish/domains/domain1/applications/TradeOnlineChat/WEB-INF/lib/* com.util.Utils

Sometimes i am getting the following error inside my logs and the result is that the script doesn't update the data

Error occurred during initialization of VM

Could not reserve enough space for object heap

Could you please tell me how to resolve this error.

l'L'l
  • 44,951
  • 10
  • 95
  • 146
Pawan
  • 31,545
  • 102
  • 256
  • 434

1 Answers1

0

I don't understand what you mean by "scheduled under contrabs every 5 minutes", however I know one thing:

Not enough heap space is normally because there is memory lacking. Reserve more RAM for your VM, if you use too much RAM already and can't reserve enough, then give up the VM.

Sometimes native Batch is better than Bash anyway (assuming host PC's OS is Windows).

wallabra
  • 412
  • 8
  • 17