Monday, October 4, 2010

NoteToSelf: JVisualVM rules. And -XX:+UseConcMarkSweepGC messes it up.

JVisualVM (under your JDK /bin directory, on Windows something like C:\Program Files\Java\jdk1.6.0_07\bin\jvisualvm.exe), released with JDK version 6, update 7, provides an awesome view into your JVM processes.

Local processes are automagically shown, which is very helpful:

The overview will give you JVM arguments and system properties. This can be very helpful when someone claims they started with one set of arguments and you believe otherwise! The Monitor tab has a nice UI for grabbing a quick heap dump and viewing it, as well as some graphs that can often immediately point out that you have a memory leak (particularly if you don't see a nice healthy saw-tooth for the heap). The Threads tab shockingly gives you information about threads and the ability to perform thread dumps. Although it has never actually been helpful for me yet the visibility into running/waiting is very cool:

Even better, JVisualVM makes monitoring remote processes very easy. Just start the remote JVM with arguments similar to java -Dcom.sun.management.jmxremote.port=7890 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false ...whatever... and then on the client start JVisualVM and choose File>Add JMX Connection and enter hostname:7890 (or whatever number you set for com.sun.management.jmxremote.port) and to see into a remote VM. You can also use jstad but in many cases we don't start this so being able to easily boot arbitrary processes as monitorable is a major plus.

Unfortunately there is a gotcha. If the JVM arguments to the process you want to watch included -XX+UseConcMarkSweepGC you will see a little red warning in the bottom right informing you there was a NullPointerException at com.sun.tools.visualvm.jvm.MonitoredDataImpl.:

This will result in the Monitor tab being completely useless; none of the graphs will populate. Apparently this is due to a bug (see https://visualvm.dev.java.net/issues/show_bug.cgi?id=128) that is fixed. Sadly the fix seems not to be deployed into my environments yet :(

10 comments:

Unknown said...

jvisualvm rocks. Orders of magnitude easier to get started with than other profilers I've used in the past. I would have never found this JSF issue without it (or if I had to re-compile/instrument classes or startup scripts to attach a profiler):

http://wrschneider.blogspot.com/2011/10/bizarre-glassfish-jsfel-performance.html

Green Laser Sight - Viridian Weapon Technologies said...

Body Cam : The Ruger lCP2 380 ACP Handgun is an inconspicuous gun ideal for concealed lug as well as individual security. The small framework of this 380 ACP gun suits a range of holsters as well as hidden bring tools, making it a wonderful option for mobile defense. Pistol Light This Ruger gun is developed with an alloy steel barrel, steel slide, and glass-filled nylon hold frame to provide a stable capturing system with dependable accuracy. For enhanced handling, the Ruger LCP II features a distinctive grip framework that has actually been made a little larger than the original Ruger Laser to extra successfully distribute recoil and lower muzzle rise. Light for Pistol

Steven Cohen said...

Do You Now AximTrade Review Login Is A Secure, Multi-channel, Multi-factor Authentication System, Enabling Customers To Securely Access Their Accounts To Fund/deposit, Request Withdrawal, Update Or Manage Their Profile And More.

Oliver said...

We can rank your site for any search term on page 1 of Google, Yahoo and Bing's search engine results For Keyword " Forex Ranking List "

Oliver said...

Whether you are a new trader or an experienced trader, Online Stock Broker provides all of the information you need to make an educated decision about which online broker to use. We have years of experience in this industry working alongside brokers, traders and market makers and we bring our knowledge and expertise to you with this guide.

Oliver said...

At Market Forex Net Our Aim Is To Provide You With The Information Necessary To Make An Educated Choice When Finding The Right Trading Service Provider. We List A Variety Of Brokers Offering Many Different Platforms And Services. Gaining Access To A Wide Range Of The Best Online Brokers Will Allow You To Compare Them Side By Side And Make The Right Decision For Your Trading Needs.

Steven Cohen said...

Check The Funff Stock Overview To Monitor A Stock And View Live Price Changes As They Occur, Including Volume And Share Changes. With Our Live, Real Time Stock Market Overview App, You No Longer Need To Refresh Your Browser Or Watch Multiple Computer Screens To View Real Time Stock Prices.

Oliver said...

Ati testing login Real-Time Overview Of A Stock, Including Recent And Historical Price Charts, News, Events, Analyst Rating Changes And Other Key Stock Information.

periyannan said...

This is the first & best article to make me satisfied by presenting good content. I feel so happy and delighted. Thank you so much for this article.
This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting.

evs full form
raw agent full form
full form of tbh in instagram
dbs bank full form
https full form
tft full form
pco full form
kra full form in hr
tbh full form in instagram story
epc full form

Gouse said...

"Great insights on using JVisualVM with Scala! I appreciate the tips on how the -XX:+UseConcMarkSweepGC option can complicate things. It’s crucial to understand how different garbage collection strategies can impact performance monitoring. I’ll definitely keep these points in mind as I work on my Scala projects. Thanks for sharing your expertise!"

Digital Marketing Course In Ameerpet

Post a Comment