Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Async Task Out of Memory Hangs Application without OOME #42

@jobeninc

Description

@jobeninc

Task List

  • Steps to reproduce provided
  • Stacktrace: N/A
  • Example that reproduces the problem uploaded to Github: N/A
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create new Grails Web Application

    • Reduce build.gradle memory usage to a reasonably small value -Xmx512m
  2. Insert an async task into the default controller

Promise promise = task {
   try {
        //Insert High Memory Usage Task
   } catch (Exception e)  {
        log.error("Exceptions does not occur here", e)
   } finally {
        //Code here does not process
   }
}
promise.onError { Exception e ->
    log.error("OOME exceptions should at least occur here, but do not", e)
}
  1. Insert High Memory Usage Task in the above comment
  • I am using a JSONSluper to read a huge JSON file and then try to write it back out to a file.
  • File must be large enough to cause an Out Of Memory Exception (OOME) if run outside of the async task
  1. Run grails run-app in your dev environment or go big and make a production environment and run the war file.

  2. Execute the task in the controller

  3. Wait for OOME, get coffee, watch movie, drink beer, concur that an OOME should occur

Expected Behaviour

An OOME Exception should occur and the task should stop processing

Actual Behaviour

The task runs indefinitely and my laptop gets hot enough to grill a hamburger

Environment Information

  • Operating System: Mac OS (Dev environment) - (Also Tested on CentOS 7 - Prod environment)
  • Grails Version: 5.2.5
  • JDK Version: Open JDK (Build 1.8.0_275-b01)
  • Container Version (If Applicable): Dev environment or Tomcat 9.0.71

Example Application

  • See simple instructions above to reproduce in any Grails application you currently have setup.
  • Github project is unnecessary

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions