Prev: Way to sort / enforce order for Map.entrySet?
Next: is it possible to call 32 bit shared libraries on 64bit os platforms?
From: Paul Cager on 22 Apr 2010 10:03 On Apr 22, 2:18 pm, Francesco <f.pall...(a)gmail.com> wrote: > I'm trying to submit to ExecutorService many processCallable (I have > to use callable because I have to feedback the returncode), but over a > quantity my JVM goes in OutOfMemory. > > My Executor is: > > private ExecutorService executor = Executors.newFixedThreadPool(30); > > I can't modify Xms and Xmx because they are too high now. > I want to clean-up the pool by the completed threads, so I can put the > newer. > > Have You some ideas? > > Thanks a lot > F. If you have a fixed thread pool there shouldn't be any completed threads - I'd guess something is holding on to completed jobs (or Futures if you are using them). If you are using a Sun JVM you can add startup flag "-XX: +HeapDumpOnOutOfMemoryError" to make sure you get a heap dump on OOM. I find "MAT" (http://www.eclipse.org/mat/) a good way to analyse heap dumps (much better than jhat).
From: Francesco on 23 Apr 2010 10:21
On 22 Apr, 16:03, Paul Cager <paul.ca...(a)googlemail.com> wrote: > On Apr 22, 2:18 pm, Francesco <f.pall...(a)gmail.com> wrote: > > > > > > > I'm trying to submit to ExecutorService many processCallable (I have > > to use callable because I have to feedback the returncode), but over a > > quantity my JVM goes in OutOfMemory. > > > My Executor is: > > > private ExecutorService executor = Executors.newFixedThreadPool(30); > > > I can't modify Xms and Xmx because they are too high now. > > I want to clean-up the pool by the completed threads, so I can put the > > newer. > > > Have You some ideas? > > > Thanks a lot > > F. > > If you have a fixed thread pool there shouldn't be any completed > threads - I'd guess something is holding on to completed jobs (or > Futures if you are using them). > > If you are using a Sun JVM you can add startup flag "-XX: > +HeapDumpOnOutOfMemoryError" to make sure you get a heap dump on OOM. > I find "MAT" (http://www.eclipse.org/mat/) a good way to analyse heap > dumps (much better than jhat). Thanks I'll try with it. |