Detecting Code Deadlock In Java Apps
Imagine youre an operations guy and youve just received a phone call or alert notifying you that the application youre responsible for is running slow
. You bring up your console in your
JVM monitoring tool, check all related processes, and notice one java.exe process is hogging all the CPU on one box. The average sys admin at this point would just kill and restart the Java process, cross their fingers, and hope everything returns to normal, and this actually works most of the time. The application returns to normal, and you pat yourself on the back for a job well done.
This story may seem contrived, but it happens all the time. The reality is that no one in operations has the time or visibility to figure out the real impact behind issues like this. Little pressure is applied to development to find the root cause to prevent production slowdowns in the future. Restarting the JVM is enough, because it appears to solve the problem. In fact, its only a temporary fix that hides the real problems in the application logic and configuration.
Now imagine that operations could actually see the business impact of production issues, along with identifying root cause, and communicate this information to dev so that it could be fixed permanently. Sounds too good to be true, right? It turns out finding the root cause behind these things isnt actually that difficult. All you need is the right
application performance monitoring tool.
A good Java
application monitoring tool will give you insight into not only the transactions that are affected by code deadlock (which gives you an idea of the true business impact) but will also help you locate the cause of the deadlock in your code.
Take, for example, one company thats using a particular APM tool. Theyve noticed that something is performing slow, and when they look at their tool they see that they have 92 code deadlocks. The main culprit of these is an application cache that is not thread-safe several threads were attempting to put, get and remove items at the same time. This caused the JVM to hang until those threads were released via a restart.
A restart in this case seems to solve the problem temporarily, this doesnt prevent it from occurring again. To do that, the operations team needs to give development some thread dumps, again from the APM tool, which show the full stack trace. This way the devs can see which classes and methods are responsible for cache access.
A problem-focused approach, with the help of the proper tools, may be more time-consuming up front but will ultimately pay off for everyone dev learns how to improve their code, ops doesnt have to restart JVMs as often, and the company saves money.
by: joseph
How To Use Coupon Codes- Best Way To Save Valuable Money Christian Codependency: 10 Things Codependents Must Do To Change Christian Codependency: 7 Signs You Are A Christian Codependent Different Engine Codes Of Audi A3 Diesel Engines Cambridge Satchel Coupon Code Move Much Better The Fashion Segment Code Free Blu Ray Player Transcends All Boundaries The Ccie Wireless Written Exam With The Code 350-050 Information About Nizamuddin, Jammu, Tirupati Railway Station Codes Cambridge Satchel Is A Fashion Bags Code At The Moment What Makes Codependency Qualify As Christian Codependency? The Security Feature Of Code Signing Certificates Karmaloop Rep Codes-ways To Get An Easy Discount How To Take Full Advantage Of Rep Codes On Karmaloop
www.yloan.com
guest:
register
|
login
|
search
IP(18.117.132.49) Georgia / Atlanta
Processed in 0.021932 second(s), 7 queries
,
Gzip enabled
, discuz 5.5 through PHP 8.3.9 ,
debug code: 14 , 3179, 403,