OutOfMemoryError when Java application invokes shell script on Linux with overcommit disabled

Solution Verified - Updated -

Issue

  • When we try to call a shell script from JBoss server we get the below exception saying cannot allocate memory.
  • We try to start multiple JBoss instances. Combined memory is less then the amount of physical memory but it is close to the limit and the system cannot allocate memory (while there should be enough)
   java.io.IOException: Cannot run program "/bin/ksh": java.io.IOException: error=12, Cannot allocate memory

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP).
    • All versions.
  • Red Hat Enterprise Linux (RHEL).
    • All versions.

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.