java.io.IOException: error=12, Cannot allocate memory

2010-11-09  张林 

Compiling EAR module in precomp.sh
java.io.IOException: Cannot run program "javac": java.io.IOException: error=12, Cannot allocate memory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
        at java.lang.Runtime.exec(Runtime.java:593)
        at weblogic.utils.Executable.exec(Executable.java:233)
        at weblogic.utils.Executable.exec(Executable.java:161)
        at weblogic.utils.Executable.exec(Executable.java:147)
        at weblogic.utils.compiler.CompilerInvoker.execCompilerBatch(CompilerInvoker.java:236)
        at weblogic.utils.compiler.CompilerInvoker.execCompiler(CompilerInvoker.java:209)
        at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:451)
        at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:332)
        at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:340)
        at weblogic.ejb.container.ejbc.CompilerForJavac.compile(CompilerForJavac.java:33)
        at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:360)
        at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:552)
        at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:490)
        at weblogic.application.compiler.AppcUtils.compileEJB(AppcUtils.java:306)
        at weblogic.application.compiler.EJBModule.compile(EJBModule.java:128)
        at weblogic.application.compiler.flow.CompileModuleFlow.compileModules(CompileModuleFlow.java:103)
        at weblogic.application.compiler.flow.CompileModuleFlow.compile(CompileModuleFlow.java:58)
        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
        at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)
        at weblogic.application.compiler.EARCompiler.compile(EARCompiler.java:49)
        at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:118)
        at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:43)
        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
        at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)
        at weblogic.application.compiler.Appc.runBody(Appc.java:181)
        at weblogic.utils.compiler.Tool.run(Tool.java:158)
        at weblogic.utils.compiler.Tool.run(Tool.java:115)
        at weblogic.application.compiler.Appc.main(Appc.java:192)
        at weblogic.appc.main(appc.java:14)
Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
        at java.lang.ProcessImpl.start(ProcessImpl.java:65)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
        ... 33 more
Exec failed .. exiting

Compiling EAR module in precomp.sh
echo "Precompiling nGen Application - estimated time = 10 minutes!"
echo "  (You may define WEBLOGIC_APPC_VMOPTS to change the VM arguments)"

if [ -z "${WEBLOGIC_APPC_VMOPTS}" ]; then
    WEBLOGIC_APPC_VMOPTS="-Xmx1024m -XX:MaxPermSize=1024M"
fi
${JDK_HOME_DIR}/bin/java ${WEBLOGIC_APPC_VMOPTS} weblogic.appc -verbose -compiler javac -J-mx500M -nowarn ${APP_EAR_NAME} 2>&1
exit_val=$?

cd ${CUR_DIR}
exit $exit_val
~
After change bewlow, Compiling EAR module successfully.
WEBLOGIC_APPC_VMOPTS="-Xmx512m -XX:MaxPermSize=512m"
-compiler javac -J
-mx900M -nowarn

[loadtest@ydcvmapp02 _internal]$ free  total 1.6G memory
             total       used       free     shared    buffers     cached
Mem:       7927716    6258568    1669148          0      13868     147280
-/+ buffers/cache:    6097420    1830296
Swap:      2096440    2094932       1508

750°/7504 人阅读/0 条评论 发表评论

登录 后发表评论