Skip to main content
Inspiring
November 11, 2008
Question

JRun OutOfMemory Restarts

  • November 11, 2008
  • 3 replies
  • 1027 views
I've got a big async process that runs nightly on my CF8 server to rebuild my product database (should take 4-5 hours when running properly), and it frequently (3-4 times per week) causes CF to restart with a JRun OutOfMemory error:

# An unexpected error has been detected by Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 16384000 bytes for GrET in C:\BUILD_AREA\jdk6_04\hotspot\src\share\vm\utilities\growableArray.cpp. Out of swap space?
#
# Internal Error (allocation.inline.hpp:42), pid=7024, tid=3756
# Error: GrET in C:\BUILD_AREA\jdk6_04\hotspot\src\share\vm\utilities\growableArray.cpp

The basic flow of the process is to do a few database queries to gather about 25,000 items, and then process each one in a grouped CFOUTPUT (need to group the query by product family, otherwise I'd normally use CFLOOP). Within each grouped iteration, I recycle a set of scalar variables for each family, so I'm not creating any persistent variables. I invoke a few CFCs via CFINVOKE to assemble some data, one of which does use Session variables, but my understanding is that all this would be considered one session. Then the data for that family is written to the database, and the loop continues to the next family.

What I don't understand is why my JRun memory usage continually creeps up and up over the course of the process. If I'm not creating persistent variables as the loop proceeds, what's accumulating there? I'm not caching any queries, I'm not building any accumulative variables, but the memory goes up and up till it causes a restart.

I'm running version 8,0,1,195765, with Java 1.6.0_04 using the following args:
-server -Dsun.io.useCanonCaches=false -XX:MaxNewSize=16m -XX:NewSize=16m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib

Can anyone suggest some steps I could take to get this thing running better? I've used the Server Monitor to watch the progress, although I can't use Memory Tracking (it eats the server up within minutes). Am I missing something really obvious in the Java configuration? Is the use of Session variables in the CFCs I invoke a bad idea?
    This topic has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    November 13, 2008
    Oh, and, check out the Server Monitor page in the Coldfusion Administrator for hints.

    Inspiring
    November 13, 2008
    jarviswabi wrote:
    > I've got a big async process that runs nightly on my CF8 server to rebuild my
    > product database (should take 4-5 hours when running properly), and it
    > frequently (3-4 times per week) causes CF to restart with a JRun OutOfMemory
    > error:
    >
    > # An unexpected error has been detected by Java Runtime Environment:
    > #
    > # java.lang.OutOfMemoryError: requested 16384000 bytes for GrET in
    > C:\BUILD_AREA\jdk6_04\hotspot\src\share\vm\utilities\growableArray.cpp. Out of
    > swap space?
    > #
    > # Internal Error (allocation.inline.hpp:42), pid=7024, tid=3756
    > # Error: GrET in
    > C:\BUILD_AREA\jdk6_04\hotspot\src\share\vm\utilities\growableArray.cpp

    That is not good. Try upgrading your JDK to 1.6u10 which should handle
    an out of memory problem more graceful. Also, how is the resource
    consumption on the server when this error occurs?


    > What I don't understand is why my JRun memory usage continually creeps up and
    > up over the course of the process.

    Do you have debugging enabled? If so, switch it off.

    Jochem


    --
    Jochem van Dieten
    Adobe Community Expert for ColdFusion
    BKBK
    Community Expert
    Community Expert
    November 12, 2008
    What happened when you used the default settings, namely:
    -server -Dsun.io.useCanonCaches=false
    -XX:MaxPermSize=192m -XX:+UseParallelGC
    -Dcoldfusion.rootDir={application.home}/../
    -Dcoldfusion.libPath={application.home}/../lib