Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > OutOfMemory using ThreadPoolExecutor

Reply
Thread Tools

OutOfMemory using ThreadPoolExecutor

 
 
Francesco
Guest
Posts: n/a
 
      04-22-2010
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.
 
Reply With Quote
 
 
 
 
Paul Cager
Guest
Posts: n/a
 
      04-22-2010
On Apr 22, 2:18*pm, Francesco <(E-Mail Removed)> 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).
 
Reply With Quote
 
 
 
 
Francesco
Guest
Posts: n/a
 
      04-23-2010
On 22 Apr, 16:03, Paul Cager <(E-Mail Removed)> wrote:
> On Apr 22, 2:18*pm, Francesco <(E-Mail Removed)> 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.
 
Reply With Quote
 
HameedDeen HameedDeen is offline
Junior Member
Join Date: Jan 2012
Posts: 1
 
      01-17-2012
Hi All,

Iam new to this forum,

I am doing the stand alone application for multi file transfereing from many clients machine to server machine using socket communication in java .I did the code to transfer files for single client to server its working fine now ,


At a time nearly 50 to 100 client machines will send many files to server.
How my server to handle this situation ? please advise

I am not aware of Thread Pool Executor .
can I Implement Thread Pool Executor part in both sever side and client side ?

please give some idea to complete my requirement. Thanks in Advance .Expecting your valuable response








Quote:
Originally Posted by Francesco View Post
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ThreadPoolExecutor with blocking execute? castillo.bryan@gmail.com Java 11 12-20-2006 05:14 PM
Suspending threads by ThreadPoolExecutor Maciej Java 1 10-27-2006 02:08 PM
OutputStream from a URLConnection produces an OutOfMemory OutputStream from a URLConnection produces an OutOfMemory WinstonSmith_101@hotmail.com Java 2 10-25-2006 04:45 PM
looking for good guide to using ThreadPoolExecutor Marc E Java 0 04-29-2006 03:13 PM
ThreadPoolExecutor implementation question allen@rrsg.ee.uct.ac.za Java 0 10-04-2005 03:14 PM



Advertisments