sexta-feira, 5 de dezembro de 2014

java.lang.OutOfMemoryError while compiling weblogic.appc is running

Hello all,

This week, after 2 months waiting Oracle to answer me in MOS I finally got the solution for my problem.

The weblogic.appc tool pre-compiles each JSP file before deploying your project to Integrated WLS, otherwise your application could take a big performance hit as it needs to compile each .JSP file after the first request. This so called "feature" could get you in some trouble if you have more 400+ .jsp files, the fact lies beyond the heap parameters in weblogic.appc compiler, the default values (-Xms128 and -Xmx512) aren't enough to a big project like that.

After some analysis Oracle Support offered me two solutions:

  • 1) Start JDeveloper with the following argument from command-line: 

      -J-Djdev.webapp.appc.addition.jvmargs=-Xmx1025m 

    Example: 

      jdevW.exe -J-Djdev.webapp.appc.addition.jvmargs=-Xmx1025m 

    Important: this argument is for internal development, hence is not officially supported and is subject to change or removal. 

    See if you can compile the project. 

    You'll notice an output like this in the compiler log: 
    --- 
    C:\Oracle\jdev111170\jdk160_24\jre\bin\javaw.exe -Xms128m -Xmx512m -XX:MaxPermSize=128m -Xverify:none -client -classpath C:\Oracle\jdev111170\jdk160_24\lib\tools.jar;C:\Oracle\jdev111170\wlserver_10.3\server\lib\weblogic.jar -Dweblogic.jsp.diagnosticWithAbsolutePath=true -Dweblogic.classloader.noJarSigners=true -Xmx1025m weblogic.appc "@C:\Users\wperezs\AppData\Local\Temp\appcCommandList4301097272113615486.txt" 
    --- 

    Notice that argument -Xmx shows twice: the first is internally passed by JDev and the second is the one we are passing with above argument. 
    This is because is not possible to override arguments we are passing internally through JDeveloper. 


    2) If the above didn't help, are left with the following options: 

    a) Disable compilation at DT when deploying to to Integrated Weblogic Server. 

    Uncheck "Compile JSP before deploying to Integrated Weblogic Server" checkbox in Project Properties > Compiler > JSP. 
Both of them worked and now my project is compiling fine. I'm thinking about permanently disabling the JSP pre-compilation as we do far more deploys locally than remote.