{"id":4233,"date":"2012-03-13T14:53:58","date_gmt":"2012-03-13T13:53:58","guid":{"rendered":"http:\/\/blog.dutchworks.nl\/?p=4233"},"modified":"2012-03-13T14:53:58","modified_gmt":"2012-03-13T13:53:58","slug":"java-profiler-comparison","status":"publish","type":"post","link":"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/","title":{"rendered":"Java Profiler Comparison"},"content":{"rendered":"<p lang=\"en-US\">While maintaining one of our client&#8217;s applications I noticed some performance problems under higher load. It seems logical to think when increasing the load on the application, that the performance will decrease. However, in my case the performance decreased at a rate much higher than when compared to the increased load. I did wonder, maybe the performance could be increased by altering the application&#8217;s logic or maybe the application had reached its limit and needed to be scaled up. In order to figure this out in more detail, I decided to do some profiling to see where the application was using most of its resources and how to tackle this problem.<\/p>\n<p lang=\"en-US\">\n<p lang=\"en-US\"><!--more--><\/p>\n<p lang=\"en-US\">There are many Java profilers out there that could help me to figure out this problem, only the question was which one should I use?<\/p>\n<p lang=\"en-US\">In order to make the right choice, I set up some minimum requirements that the profiler should meet:<\/p>\n<ul>\n<li>\n<p lang=\"en-US\">The layout of application flow should include classes and methods against time<\/p>\n<\/li>\n<li>\n<p lang=\"en-US\">Memory monitoring must be included<\/p>\n<\/li>\n<li>\n<p lang=\"en-US\">Usability must be featured<\/p>\n<\/li>\n<\/ul>\n<p lang=\"en-US\">My setup is a <a title=\"Spring\" href=\"http:\/\/www.springsource.org\/\">Spring<\/a> based application with a RESTful interface using the <a title=\"MongoDB\" href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> as its data store. It also uses <a title=\"Solr\" href=\"http:\/\/lucene.apache.org\/solr\/\">Solr<\/a> for searching. The application is deployed on <a title=\"Tomcat\" href=\"http:\/\/tomcat.apache.org\/\">Tomcat<\/a> server.<\/p>\n<p lang=\"en-US\">My options were:<\/p>\n<p lang=\"en-US\"><strong>VisualVM<\/strong><\/p>\n<p lang=\"en-US\"><a title=\"VisualVM\" href=\"http:\/\/visualvm.java.net\/\">VisualVM<\/a> is a resource profile tool that comes with <a title=\"JDK\" href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/index.html\">JDK<\/a> starting from 6 update 7. It has default memory and CPU monitoring. It can tell you which classes and methods are hit, but it will not show the flow through the application.<\/p>\n<p lang=\"en-US\"><strong>JProfiler<\/strong><\/p>\n<p lang=\"en-US\"><a title=\"JProfiler\" href=\"http:\/\/www.ej-technologies.com\/products\/jprofiler\/overview.html\">JProfiler<\/a> was easy to set up and it walked me through a wizard where you can select the application server used to run the application. I had to select the application server home directory and the wizard generated a separate start up script for the application server to use with JPofiler. Then I run the server and it did wait till JProfiler connected to it. I attached the session to the listening process and it gave couple options. I could record memory usage and CPU usage. I went for the CPU usage and could see the execution path. This gave me a nice overview of where the request took the most time. Using the plugin for my IDE, <a title=\"IntelliJ\" href=\"http:\/\/www.jetbrains.com\/idea\/\">IntelliJ<\/a> in my case, running JProfiler is even easier. I didn&#8217;t have to generate separate Tomcat startup. That was taken care of by the IntelliJ plugin.<\/p>\n<p lang=\"en-US\"><strong>YourKit<\/strong><\/p>\n<p lang=\"en-US\"><a title=\"YourKit\" href=\"http:\/\/www.yourkit.com\/\">YourKit<\/a> is one of the profilers that I came across on another project. The setup was very easy. The setup gave me an option to install a plugin for my IDE. After setup I run the application using the plugin and it automatically attached the process to YourKit. It showed me a nice user interface with tabs like memory monitoring and CPU profiling. I took a snapshot of the CPU time and could see the execution path for my request.<\/p>\n<p lang=\"en-US\"><strong>JProbe<\/strong><\/p>\n<p lang=\"en-US\">I had some difficulties to get started with <a title=\"JProbe\" href=\"http:\/\/www.quest.com\/jprobe\/\">JProbe<\/a>. The installation was not straight forward I did figure out the configuration eventually. It uses a similar setup like JProfiler. It generates a start up script in your Tomcat directory. I started the server through the script and attached the session to it. The interface had buttons and tables everywhere and I got lost in the UI. I did see the memory usage, but couldn&#8217;t find the execution path of my process.<\/p>\n<p lang=\"en-US\"><strong>Spring Insight<\/strong><\/p>\n<p lang=\"en-US\">Hearing about the <a title=\"Spring Insight\" href=\"http:\/\/www.springsource.org\/insight\">Spring Insight<\/a> monitoring interface as part of the <a title=\"TC Server\" href=\"http:\/\/www.springsource.com\/developer\/tcserver\">TC Server<\/a> I was excited to try it out. After installing and setting up a TC Server developer edition, I deployed the application on the TC Server instance. I browsed to the Insight interface where I could monitor my application&#8217;s flow. It gave me a nice flow layout of the classes and methods. It showed me how much time the methods took to complete. I could see the values of input parameters as well as the return values. Because my application is Spring based, Spring Insight presented very useful data about my application. A TC Server plugin is available for my IDE for configuring an instance that is similar to Tomcat configuration. The <a title=\"SpringSource Tool Suite\" href=\"http:\/\/www.springsource.com\/developer\/sts\">SpringSource Tool Suite<\/a> comes bundles with Spring Insight.<\/p>\n<p lang=\"en-US\"><strong>Conclusion<\/strong><\/p>\n<p lang=\"en-US\">Having seen these five profiling tools, I can safely say that I am very optimistic about all their possibilities. If you have Spring based application the right choice for development is clearly the Spring Insight. It is free for development purposes, but your application needs to be deployed on the TC Server.<\/p>\n<p lang=\"en-US\">If you want more freedom in monitoring local and remote processes I would go for JProfiler or YourKit. These two can also assist the Spring Insight monitoring in your conquest in finding performance bottlenecks.<\/p>\n<p lang=\"en-US\">Both JProfiler and YourKit meet my requirements described above. JProfiler, YourKit and Spring Insight can trace the flow through the classes and methods of the application. JProfiler and YourKit show memory usage. Although Spring Insight cannot show memory usage, it shows the throughput trend nicely. These three profilers are very clear, not confusing and easy to use. And finally they have nice plugins for my IDE. Hope this little journey helps you make the right choices too.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While maintaining one of our client&#8217;s applications I noticed some performance problems under higher load. It seems logical to think when increasing the load on the application, that the performance will decrease. However, in my case the performance decreased at a rate much higher than when compared to the increased load. I did wonder, maybe [&hellip;]<\/p>\n","protected":false},"author":33,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[10],"tags":[151,284],"class_list":["post-4233","post","type-post","status-publish","format-standard","hentry","category-development","tag-performance","tag-profiler"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java Profiler Comparison - Trifork Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Profiler Comparison - Trifork Blog\" \/>\n<meta property=\"og:description\" content=\"While maintaining one of our client&#8217;s applications I noticed some performance problems under higher load. It seems logical to think when increasing the load on the application, that the performance will decrease. However, in my case the performance decreased at a rate much higher than when compared to the increased load. I did wonder, maybe [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/\" \/>\n<meta property=\"og:site_name\" content=\"Trifork Blog\" \/>\n<meta property=\"article:published_time\" content=\"2012-03-13T13:53:58+00:00\" \/>\n<meta name=\"author\" content=\"Denis Tunovi\u0107\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Denis Tunovi\u0107\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/\",\"url\":\"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/\",\"name\":\"Java Profiler Comparison - Trifork Blog\",\"isPartOf\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#website\"},\"datePublished\":\"2012-03-13T13:53:58+00:00\",\"author\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/4775eda181e3a29deebe1805dca85253\"},\"breadcrumb\":{\"@id\":\"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trifork.nl\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Profiler Comparison\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trifork.nl\/blog\/#website\",\"url\":\"https:\/\/trifork.nl\/blog\/\",\"name\":\"Trifork Blog\",\"description\":\"Keep updated on the technical solutions Trifork is working on!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trifork.nl\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/4775eda181e3a29deebe1805dca85253\",\"name\":\"Denis Tunovi\u0107\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9fdecfbf048b60323e98f65d8b7475a5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9fdecfbf048b60323e98f65d8b7475a5?s=96&d=mm&r=g\",\"caption\":\"Denis Tunovi\u0107\"},\"url\":\"https:\/\/trifork.nl\/blog\/author\/denis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Profiler Comparison - Trifork Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/","og_locale":"en_US","og_type":"article","og_title":"Java Profiler Comparison - Trifork Blog","og_description":"While maintaining one of our client&#8217;s applications I noticed some performance problems under higher load. It seems logical to think when increasing the load on the application, that the performance will decrease. However, in my case the performance decreased at a rate much higher than when compared to the increased load. I did wonder, maybe [&hellip;]","og_url":"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/","og_site_name":"Trifork Blog","article_published_time":"2012-03-13T13:53:58+00:00","author":"Denis Tunovi\u0107","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Denis Tunovi\u0107","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/","url":"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/","name":"Java Profiler Comparison - Trifork Blog","isPartOf":{"@id":"https:\/\/trifork.nl\/blog\/#website"},"datePublished":"2012-03-13T13:53:58+00:00","author":{"@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/4775eda181e3a29deebe1805dca85253"},"breadcrumb":{"@id":"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trifork.nl\/blog\/java-profiler-comparison\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/trifork.nl\/blog\/java-profiler-comparison\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trifork.nl\/blog\/"},{"@type":"ListItem","position":2,"name":"Java Profiler Comparison"}]},{"@type":"WebSite","@id":"https:\/\/trifork.nl\/blog\/#website","url":"https:\/\/trifork.nl\/blog\/","name":"Trifork Blog","description":"Keep updated on the technical solutions Trifork is working on!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trifork.nl\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/4775eda181e3a29deebe1805dca85253","name":"Denis Tunovi\u0107","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9fdecfbf048b60323e98f65d8b7475a5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9fdecfbf048b60323e98f65d8b7475a5?s=96&d=mm&r=g","caption":"Denis Tunovi\u0107"},"url":"https:\/\/trifork.nl\/blog\/author\/denis\/"}]}},"_links":{"self":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/4233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/comments?post=4233"}],"version-history":[{"count":0,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/4233\/revisions"}],"wp:attachment":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media?parent=4233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/categories?post=4233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/tags?post=4233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}