OutOfMemory using ThreadPoolExecutor

F

Francesco

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.
 
P

Paul Cager

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).
 
F

Francesco

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.
 
Joined
Jan 17, 2012
Messages
1
Reaction score
0
Multi client communicates the server at a time

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








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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top