[SNMP4J] Threads are being blocked in snmp4j 1.8 RC1

Frank Fock fock at agentpp.com
Mon Jan 22 20:01:02 CET 2007


Hi Varma,

For what reason are you using 250 threads??? That's about
250 MB memory footprint for the thread stack only. Do
you have a system with 250 CPUs? Otherwise, those threads
also waste thread context switching CPU cycles too.

OK, back to the locked threads problem: The
SyncResponseListener is created per request, thus there could
not be two requests blocking on the same SyncResponseListener
instance.

The only situation where requests could block forever on
the SyncResponseListener is when the close() method of the
Snmp instance has been called *before* the request has
been sent or if the internal Timer thread died or could not
be started due to a OutOfMemoryException.

Best regards,
Frank

varma datla wrote:
> Hi Frank,
> I am using the snmp4j 1.8 RC1 library (multi-threaded, synchronous) in a tomcat application with 250 threads. Also using 3 retries and 500,1000,5000 as timeouts per request.
> After a while, the whole application is blocked and  doing nothing. A JConsole lookup revealed that all the threads are waiting on org.snmp4j.Snmp$SyncResponseListener class. 
> 
> Any ideas?
> 
> JConsole  output:
> 
> Name: pool-1-thread-1 
> State: WAITING on org.snmp4j.Snmp$SyncResponseListener at 676bc7 
> Total blocked: 7,546  Total waited: 127,560 
> 
> Stack trace: 
> java.lang.Object.wait(Native Method) 
> java.lang.Object.wait(Object.java:474) 
> org.snmp4j.Snmp.send(Unknown Source) 
> org.snmp4j.Snmp.send(Unknown Source) 
> ..............
> .............
>  
> 
> Thank you and I appreciate any suggestions to overcome this problem.
> 
> Varma
> 
>  
> ---------------------------------
> Now that's room service! Choose from over 150,000 hotels 
> in 45,000 destinations on Yahoo! Travel to find your fit.
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list