This repository was archived by the owner on Oct 11, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Copy link
Copy link
Open
Description
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
-
Create new Grails Web Application
- Reduce
build.gradlememory usage to a reasonably small value-Xmx512m
- Reduce
-
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)
}- Insert High Memory Usage Task in the above comment
- I am using a
JSONSluperto read a hugeJSONfile 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
-
Run grails run-app in your dev environment or go big and make a production environment and run the war file.
-
Execute the task in the controller
-
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
Labels
No labels