Skip to main content
Known Participant
March 17, 2011
Question

Java heap space

  • March 17, 2011
  • 5 replies
  • 2049 views

I have been developing in ColdFusion for over seven years, and have never encountered this; I'm hoping someone else has and can help.  I'm running a scheduled task that gets a query of 15,000 email addresses from the database, loops through that query, and for each record queues up an email to be sent.  While the process is running, the following error is reported in the application.log in the ColdFusion Administator: "Java heap space".  Additionally, last night I saw the following error: "GC overhead limit exceeded".  These caused the task to abort, and only 1500 or so of the emails were sent.  Can anyone offer some advice as to how to correct this?  Thank you in advance.

    This topic has been closed for replies.

    5 replies

    jimt82977416
    Participant
    July 17, 2019

    There are 8 types of OutOfMemoryError. In this, 5 types of OutOfMemoryError happens within the JVM heap.

    1. Java heap space
    2. GC overhead limit exceeded
    3. Requested array size exceeds VM limit
    4. Permgen space
    5. Metaspace

    Remaining 3 types of OutOfMemoryError happens outside the heap:

    6. Unable to create new native thread
    7. Kill process or sacrifice child
    8. reason stack_trace_with_native_method

    Diagnosing the memory leaks

    Based on the GC algorithm, Java version, JVM provider and memory arguments that you pass, GC log format will vary. GCeasy is an online GC log analyzer which can analyze GC logs of any format.

    BKBK
    Community Expert
    Community Expert
    July 20, 2019

    I would consider this thread closed. When it started in March 2011, the ColdFusion version was 9.

    The technology has moved on quite a bit since then.

    Legend
    March 21, 2011


    Hi,

    Sorry I got interrupted before and thought I was going to be a while so  I was scant on detail in the posting.

    Some details about your environment might be good to know eg Win03 32 bit, CF8.0.1 Standard, JVM version 1.6.0_4? The next relevant details would be what are the JVM arguments from CF\runtime\bin\JVM.CONFIG eg:
    # Arguments to VM
    java.args=-server  -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC  -Dcoldfusion.rootDir=etc...

    While you can set a JVM argument not at reach GCoverheadlimit I differ in that I think it would be better to know why so many GC’s are occurring at once then either fix the app (read others posting about loops) or adjust the JVM arguments to match the environment better.

    HTH, Carl.

    Legend
    March 21, 2011

    Hi,

    CF runs on Java. Java is made up of heap and non heap memory spaces. Memory is freed up by Garbage Collector routines. I did a talk on this recently at CFMEETUP:

    http://experts.adobeconnect.com/p55663036

    HTH, Carl.

    existdissolve
    Inspiring
    March 17, 2011

    Did you Google the errors? I did separate searches for "ColdFusion Java heap space" and "ColdFusion GC Overhead limit exceeded", and found a lot of articles that explain the issue, as well as provide some suggestions for solutions.

    Take a look at this one: http://www.petefreitag.com/item/746.cfm

    Inspiring
    March 17, 2011

    It might not make a difference, but is there any reason you are looping through a query instead of using the query attribute of cfmail?