Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does an external process run from Runtime.getRuntime().exec(command) get its memory from?

I have a Java application running under JBoss AS 7 that is used to call a fairly complicated bash script using Runtime.getRuntime().exec(command). The bash script is failing because cvs is reporting that it is running out of memory (the error was "E342: Out of memory!" to be exact).

So should I be increasing the amount of memory available to JBoss AS (with JAVA_OPTS="-Xms256m -Xmx2048m" or something similar), or does this indicate that the OS itself has run out of memory?

like image 728
Phyxx Avatar asked Mar 09 '26 17:03

Phyxx


1 Answers

The operating system is running out of memory. Increasing JBoss's heap size can only make things worse.

You should be looking at things like:

  • Adding more RAM.
  • Increasing the amount of swap disk space.
  • Cutting down on the other applications running.
like image 95
Stephen C Avatar answered Mar 12 '26 07:03

Stephen C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!