[JAVA-186] Memory Leak Created: 12/Oct/10 Updated: 29/Oct/10 Resolved: 12/Oct/10 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Eli Fox-Epstein | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
Run this https://gist.github.com/b905d59e9af00a7ad33f to reproduce. Java eats up all of its heap then tries to GC over and over again without freeing up any memory. I think that the problem is in BasicOutputBuffer. |
| Comments |
| Comment by Henrik Johansson [ 13/Oct/10 ] |
|
You are right of course! Its the internal queue in the executor that grows endlessly due to the endless while loop. Well, a reality check every now and then can't hurt! |
| Comment by Eliot Horowitz (Inactive) [ 12/Oct/10 ] |
|
Please see foo.java attached. |
| Comment by Henrik Johansson [ 12/Oct/10 ] |
|
Not sure that that is the whole story, replacing the tasks with a single runnable produces the same result. Giving the JVM a large amount of memory does not help. Time between GC approaches 0 as execution time grows after which it blows up. Removing the mongodb code from the runnable and increasing the memory makes it perform a full GC every second but still die with oom after a while. I think that its just too fast so the GC can't cope. Still Eliot please remove the explicit calls to gc() in the driver. |
| Comment by Eliot Horowitz (Inactive) [ 12/Oct/10 ] |
|
Running your test through a profiler, the issue is you create an infinite number of worker tasks. |