This article describes different versions of the"java.lang.OutOfMemoryError" error you might get and provides solutions or workarounds for each.

java.lang.OutOfMemoryError <>:

  • ColdFusion MX ships with the Sun 1.3.1._03 JVM which has a maximum permanent memory generation size that defaults to 64MB. The permanent generation is the area of the heap where the JVM stores its internal information, such as information about loaded Java classes. This memory is involved in the garbage collection of persistent objects. Because ColdFusion MX loads a large number of classes over time, the default size may be too small. Most application server vendors suggest increasing this parameter when encountering an out of memory condition.

    Workaround:
    Change the maximum permanent memory generation size to a higher value.

    1. In the ColdFusion MX Administrator, navigate to the Java and JVM page.
    2. In the JVM Arguments field, add the following line: -XX:MaxPermSize=128m Note: When specifying multiple arguments, options must be separated by spaces.
    3. Click Submit Changes to save changes.
    4. Restart the ColdFusion Application Server service for changes to take effect.
  • When using the NTAuth class to authenticate against a domain, ColdFusion will hang if the domain is not available or if you specify an incorrect domain. If the domain is not available, the memory spikes for the jrun.exe process and ColdFusion will stop responding. In some cases, you may get the OutOfMemoryError.

    Workaround:
    This issue was resolved in ColdFusion MX Updater release 1. Download and install the latest Updater.

java.lang.OutOfMemoryError: unable to create new native thread:

  • This error is caused by Macromedia issue 47982, where monitor threads would be spawned when using cfquery with theTimeout attribute. These threads would continue to be created with each cfquery connection, eventually leading to the "java.lang.OutOfMemoryError: unable to create new native thread" error when the JVM could no longer create any more threads. This issue was resolved in ColdFusion MX Updater release 2.

    Workaround:
    Download and install the latest Updater.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy