Professional Documents
Culture Documents
Hangs
• If current thread shows stack from JNI call from application code:
Fix: Instruct customer that its application bug and needs to be fixed in
their code.
• If the current shows stack from native code from weblogic SSL
WorkAround:Use pure java version of SSL instead of native version
• If the current thread indicates crash from compiled/optimized code:
WorkAround: Turn off the compilation and hence optimization
(-Xint)
Javacode->bytecode->compilation->optimization(hotspots)
Fix: Work with JVM vendor support.
For eg:
"ExecuteThread: '95' for queue: 'default'" daemon prio=5 tid=0x411cf8 nid=0x6c waiting
for monitor entry [0xd0f80000..0xd0f819d8]
at weblogic.common.internal.ResourceAllocator.release(ResourceAllocator.java:766)
at weblogic.jdbc.common.internal.ConnectionEnv.destroy(ConnectionEnv.java:590)
The above thread is waiting to acquire lock on ResourceAllocator object.
The next step is to identify the thread that is holding the ResourceAllocator object
"ExecuteThread: '0' for queue: '__weblogic_admin_rmi_queue'" daemon prio=5 tid=0x41b978
nid=0x77 waiting for monitor entry [0xd0480000..0xd04819d8]
at
weblogic.jdbc.common.internal.ConnectionEnv.getPrepStmtCacheHits(ConnectionEnv.java:174)
at weblogic.common.internal.ResourceAllocator.getPrepStmtCacheHitCount
(ResourceAllocator.java:1525)
This thread is holding lock on ResourceAllocator object,
but is waiting for ConnectionEnv object. This is a classic deadlock.
• Threads in wait()
A sample dump:
"ExecuteThread: '10' for queue: 'SERV_EJB_QUEUE'" daemon prio=5 tid=0x005607f0
nid=0x30 in Object.wait() [83300000..83301998]
at java.lang.Object.wait(Native Method)
- waiting on <0xc357bf18> (a weblogic.ejb20.pool.StatelessSessionPool)
at weblogic.ejb20.pool.StatelessSessionPool.waitForBean(StatelessSessionPool.java:222)
The above thread would come out of wait() under two conditions
(depending on application logic)
1) One of the thread available in the execute queue pool would call notify() on this object
when an instance is available. (If the wait() is indefinite).
This can cause the thread to hang for ever if server never does a notify() to this object.
2) If the timeout exceeds, the thread would throw an exception and back to execute queue
thread pool.
• Samurai
http://yusuke.homeip.net/samurai/?english#content_1_0
• TCP Parameters
– tcp_time_wait_interval
– tcp_keepalive_interval
– ndd -set /dev/tcp “parameter” “value”
• File Descriptors
– /etc/system
• set rlim_fd_cur 8192 (Soft Limit)
• set rlim_fd_max 8192 (Hard Limit)
• Heap Size
– -Xms, -Xmx
• Young Generation Space
– - XX:NewRatio, -XX:NewSize, -XX:MaxNewSize,
• Survivor Space
– -XX:SurvivorRatio
• Permanent Generation
– -XX:PermSize & -XX:MaxPermSize
• Aggressive Heap
– -XX:+AggressiveHeap
• For more information and self learning look at http://
www.petefreitag.com/articles/gctuning/
• StuckThread Detection
– Detects when execute thread can not complete
work or accept new work.
– Warning purpose only, doesn’t change
behaviour/state of the thread.
– Stuck Thread Max Time , Stuck Thread Timer
Interval
• Connection Backlog Buffering
– The number of backlogged TCP connection
requests.
• Sizing
– Initial capacity and Maximum capacity.
– Shrink Frequency.
• Testing
– Test Frequency.
– Test Reserved/ Released Connections
– Maximum Connections Made Unavailable
– Test Table Name
• Leaked Connection
– Forcibly reclaims unused connection.
– Inactive Connection Timeout.
• Connection Request Timeout.
– Connection Reserve Timeout.
– Maximum number of request that can wait for
connection.
• PinnedToThread
– Pins Connection to ExecuteThread
– Connection.close() doesn’t return connection to pool.
• java.lang.OutOfMemoryError , is a symptom ,
however it is not a proof.
• Turn on verbose:gc for GC logs, i.e.
– [Full GC 154K->99K(32576K), 0.0085354 secs]
• Analyze GC for following scenarios,
• Full Garbage collection does not get chance to run before
OutOfMemory is thrown.
• OutOfMemory is thrown eventhough memory usage is not
reached to upper limit of the heap
• OutOfMemory is thrown during the load test ramp up.
– Tune -XX:MaxPermSize, -Xms, -Xmx, -XX:NewSize,
-XX:MaxNewSize XX:SurvivorRatio to resolve OOM.
• Standards
– ECPerf
• J2ee Benchmark for Application Servers
– SPECjAppServer2001
• Benchmark to measure Application Server performance
– SPEC JBB2000
• Server side JVM performance benchmark.
• http://www.spec.org/jbb2000/
• Tools
– OptimizeIt, JProbe, PerformaSure.
– Mercury LoadRunner, WebLoad, Grinder(OpenSource)