0 Replies Latest reply on Sep 24, 2007 9:06 AM by 3004

    java.io.IOException: Cannot allocate memory

    3004
      Hi all,
      What is the root cause of java.io.IOException: Cannot allocate memory? the
      exception is throws every several days.
      the application is a web application that run in WLS 8.1 sp3.
      source code that throws the exception like bellow, in a http request, the
      method will be called not more than 4 times.
      public void doit() throws IOException {
      Process process = java.lang.Runtime.getRuntime().exec("chmod 777 -R
      /fileroot");
      setProcess(process);
      }

      Error message:
      java.io.IOException: java.io.IOException: Cannot allocate memory
      at java.lang.UNIXProcess.<init>(UNIXProcess.java:143)
      at java.lang.Runtime.execInternal(Native Method)
      at java.lang.Runtime.exec(Runtime.java:566)
      at java.lang.Runtime.exec(Runtime.java:428)
      at java.lang.Runtime.exec(Runtime.java:364)
      at java.lang.Runtime.exec(Runtime.java:326)

      Runtime env overview
      1. WLS start commond
      /opt/bea/jdk142_04/bin/java -server -Xms2048m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=512m
      -Dweblogic.Name=myserver -Dweblogic.management.username=wlsUser -Dweblogic.management.password=wlsPWD
      -Dweblogic.ProductionModeEnabled=true

      2. JVM version /opt/bea/jdk142_04/bin/java -version
      java version "1.4.2_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

      3. OS version # uname -a
      Linux 2.4.21-9.0.1.ELsmp #1 SMP Mon Feb 9 22:26:51 EST 2004 i686 i686 i386
      GNU/Linux
      4. top command response
      20:29:04 up 5 days, 13:51, 1 user, load average: 0.03, 0.03, 0.00
      56 processes: 55 sleeping, 1 running, 0 zombie, 0 stopped
      CPU states: cpu user nice system irq softirq iowait idle
      total 6.6% 0.0% 0.0% 0.2% 0.0% 0.0% 93.0%
      cpu00 0.0% 0.0% 0.0% 0.9% 0.0% 0.0% 99.0%
      cpu01 12.8% 0.0% 0.0% 0.0% 0.0% 0.0% 87.1%
      cpu02 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 100.0%
      cpu03 13.8% 0.0% 0.0% 0.0% 0.0% 0.0% 86.1%
      Mem: 4124016k av, 2905472k used, 1218544k free, 0k shrd, 153952k
      buff
      1327256k active, 1262088k inactive
      Swap: 2097136k av, 0k used, 2097136k free 1686144k
      cached

      Many thanks for reading my post and any advice would be greatly appreciated


      Thanks,

      Steve