{"id":6238,"date":"2012-12-31T22:00:12","date_gmt":"2012-12-31T20:00:12","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=6238"},"modified":"2012-12-27T12:38:44","modified_gmt":"2012-12-27T10:38:44","slug":"java-thread-retained-memory-analysis","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html","title":{"rendered":"Java Thread: retained memory analysis"},"content":{"rendered":"<p>This article will provide you with a tutorial allowing you to determine how much and where <a href=\"http:\/\/javaeesupportpatterns.blogspot.com\/2012\/02\/java-heap-space-what-is-it.html\">Java heap space<\/a> is retained from your <strong>active<\/strong> application Java threads. A true case study from an Oracle Weblogic 10.0 production environment will be presented in order for you to better understand the analysis process.<\/p>\n<p>We will also attempt to demonstrate that excessive garbage collection or Java heap space memory footprint problems are often not caused by true memory leaks but instead due to thread execution patterns and high amount of short lived objects.<img decoding=\"async\" class=\"alignright\" style=\"border: 0px none;\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/Java_thread_retained_memory_analysis.png\" alt=\"\" width=\"243\" height=\"94\" border=\"0\" \/><br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<h2>Background<\/h2>\n<p>As you may have seen from my past <a href=\"http:\/\/www.javacodegeeks.com\/2012\/03\/jvm-how-to-analyze-thread-dump.html\">JVM overview<\/a> article, Java threads are part of the JVM fundamentals. Your Java heap space memory footprint is driven not only by static and long lived objects but also by short lived objects.<\/p>\n<p>OutOfMemoryError problems are often wrongly assumed to be due to memory leaks. We often overlook faulty thread execution patterns and short lived objects they \u201cretain\u201d on the Java heap until their executions are completed. In this problematic scenario:<\/p>\n<ul>\n<li>Your \u201cexpected\u201d application short lived \/ stateless objects (XML, JSON data payload etc.) become retained by the threads for too long (thread lock contention, huge data payload, slow response time from remote system etc.)<\/li>\n<li>Eventually such short lived objects get promoted to the long lived object space e.g. OldGen\/tenured space by the garbage collector<\/li>\n<li>As a side effect, this is causing the OldGen space to fill up rapidly, increasing the Full GC (major collections) frequency<\/li>\n<li>Depending of the severity of the situation this can lead to excessive GC garbage collection, increased JVM paused time and ultimately <a href=\"http:\/\/javaeesupportpatterns.blogspot.ca\/2011\/11\/outofmemoryerror-java-heap-space.html\">OutOfMemoryError: Java heap space<\/a><\/li>\n<li>Your application is now down, you are now puzzled on what is going on<\/li>\n<li>Finally, you are thinking to either increase the Java heap or look for memory leaks\u2026are you really on the right track?<\/li>\n<\/ul>\n<p>In the above scenario, you need to look at the thread execution patterns and determine how much memory each of them retain at a given time.<\/p>\n<h2>OK I get the picture but what about the thread stack size?<\/h2>\n<p>It is very important to avoid any confusion between thread stack size and Java memory retention. The thread stack size is a special memory space used by the JVM to store each method call. When a thread calls method A, it \u201cpushes\u201d the call onto the stack. If method A calls method B, it gets also pushed onto the stack. Once the method execution completes, the call is \u201cpopped\u201d off the stack.<\/p>\n<p>The Java objects created as a result of such thread method calls are allocated on the Java heap space. Increasing the thread stack size will definitely not have any effect. Tuning of the thread stack size is normally required when dealing with java.lang.stackoverflowerror or <a href=\"http:\/\/javaeesupportpatterns.blogspot.ca\/2012\/09\/outofmemoryerror-unable-to-create-new.html\">OutOfMemoryError: unable to create new native thread<\/a> problems.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/Java_thread_stack_vs_java_heap.png\"><img decoding=\"async\" class=\"aligncenter\" style=\"border: 0px none;\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/Java_thread_stack_vs_java_heap.png\" alt=\"\" width=\"524\" height=\"353\" border=\"0\" \/><\/a><\/p>\n<h2>Case study and problem context<\/h2>\n<p>The following analysis is based on a true production problem we investigated recently.<\/p>\n<ul>\n<li>Severe performance degradation was observed from a Weblogic 10.0 production environment following some changes to the user web interface (using Google Web Toolkit and JSON as data payload)<\/li>\n<li>Initial analysis did reveal several occurrences of OutOfMemoryError: Java heap space errors along with excessive garbage collection. <a href=\"http:\/\/javaeesupportpatterns.blogspot.com\/2012\/11\/java-heap-dump-are-you-up-to-task.html\">Java heap dump<\/a> files were generated automatically (-XX:+HeapDumpOnOutOfMemoryError) following OOM events<\/li>\n<li>Analysis of the verbose:gc logs did confirm full depletion of the 32-bit HotSpot JVM OldGen space (1 GB capacity)<\/li>\n<li>Thread dump snapshots were also generated before and during the problem<\/li>\n<li>The only problem mitigation available at that time was to restart the affected Weblogic server when problem was observed<\/li>\n<li>A rollback of the changes was eventually performed which did resolve the situation<\/li>\n<\/ul>\n<p>The team first suspected a memory leak problem from the new code introduced.<\/p>\n<h2>Thread dump analysis: looking for suspects\u2026<br \/>\n<\/h2>\n<p>The first analysis step we did was to perform an analysis of the generated thread dump data. Thread dump will often show you the culprit threads allocating memory on the Java heap. It will also reveal any hogging or stuck thread attempting to send and receive data payload from a remote system.<\/p>\n<p>The first pattern we noticed was a good correlation between OOM events and STUCK threads observed from the Weblogic managed servers (JVM processes). Find below the primary thread pattern found:<\/p>\n<pre class=\u00a8brush:bash\u00a8>&lt;10-Dec-2012 1:27:59 o'clock PM EST&gt; &lt;Error&gt; &lt;BEA-000337&gt;\r\n\r\n&lt;[STUCK] ExecuteThread: '22' for queue:\r\n\r\n'weblogic.kernel.Default (self-tuning)'\r\n\r\nhas been busy for '672' seconds working on the request\r\n\r\nwhich is more than the configured time of '600' seconds.<\/pre>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/thread_dump_json_memort.png\"><img decoding=\"async\" class=\"aligncenter\" style=\"border: 0px none;\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/thread_dump_json_memort.png\" alt=\"\" width=\"590\" height=\"841\" border=\"0\" \/><\/a><\/p>\n<p>As you can see, the above thread appears to be STUCK or taking very long time to read and receive the JSON response from the remote server. Once we found that pattern, the next step was to correlate this finding with the JVM heap dump analysis and determine how much memory these stuck threads were taking from the Java heap.<\/p>\n<h2>Heap dump analysis: retained objects exposed!<br \/>\n<\/h2>\n<p>The <a href=\"http:\/\/javaeesupportpatterns.blogspot.com\/2012\/11\/java-heap-dump-are-you-up-to-task.html\">Java heap dump<\/a> analysis was performed using <a href=\"http:\/\/javaeesupportpatterns.blogspot.com\/2011\/11\/memory-analyzer-download.html\">MAT<\/a>. We will now list the different analysis steps which did allow us to pinpoint the retained memory size and source.<\/p>\n<h4>1. Load the HotSpot JVM heap dump<br \/>\n<\/h4>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java_thread_retained_memory_hd1.png\"><img decoding=\"async\" class=\"aligncenter\" style=\"border: 0px none;\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java_thread_retained_memory_hd1.png\" alt=\"\" width=\"514\" height=\"406\" border=\"0\" \/><\/a><\/p>\n<h4>2. Select the HISTOGRAM view and filter by \u201cExecuteThread\u201d<br \/>\n<\/h4>\n<p><em>* ExecuteThread is the Java class used by the Weblogic kernel for thread creation &amp; execution *<\/em><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java_thread_retained_memory_hd2.png\"><img decoding=\"async\" class=\"aligncenter\" style=\"border: 0px none;\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java_thread_retained_memory_hd2.png\" alt=\"\" width=\"500\" height=\"403\" border=\"0\" \/><\/a><\/p>\n<p>As you can see, this view was quite revealing. We can see a total of 210 Weblogic threads created. The total retained memory footprint from these threads is 806 MB. This is pretty significant for a 32-bit JVM process with 1 GB OldGen space. This view alone is telling us that the core of the problem and memory retention originates from the threads themselves.<\/p>\n<h4>3. Deep dive into the thread memory footprint analysis<br \/>\n<\/h4>\n<p>The next step was to deep dive into the thread memory retention. To do this, simply right click over the ExecuteThread class and select: List objects &gt; with outgoing references.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java_thread_retained_memory_hd3.png\"><img decoding=\"async\" class=\"aligncenter\" style=\"border: 0px none;\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java_thread_retained_memory_hd3.png\" alt=\"\" width=\"439\" height=\"407\" border=\"0\" \/><\/a><\/p>\n<p>As you can see, we were able to correlate STUCK threads from the thread dump analysis with high memory retention from the heap dump analysis. The finding was quite surprising.<\/p>\n<h4>4. Thread Java Local variables identification<br \/>\n<\/h4>\n<p>The final analysis step did require us to expand a few thread samples and understand the primary source of memory retention.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java_thread_retained_memory_hd4.png\"><img decoding=\"async\" class=\"aligncenter\" style=\"border: 0px none;\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java_thread_retained_memory_hd4.png\" alt=\"\" width=\"575\" height=\"263\" border=\"0\" \/><\/a><\/p>\n<p>As you can see, this last analysis step did reveal huge JSON response data payload at the root cause. That pattern was also exposed earlier via the thread dump analysis where we found a few threads taking very long time to read &amp; receive the JSON response; a clear symptom of huge data payload footprint.<\/p>\n<p>It is crucial to note that short lived objects created via local method variables <strong>will<\/strong> show up in the heap dump analysis. However, some of those will only be visible from their parent threads since they are not referenced by other objects, like in this case. You will also need to analyze the thread stack trace in order to identify the true caller, followed by a code review to confirm the root cause.<\/p>\n<p>Following this finding, our delivery team was able to determine that the recent JSON faulty code changes were generating, under some scenarios, huge JSON data payload up to 45 MB+. Given the fact that this environment is using a 32-bit JVM with only 1 GB of OldGen space, you can understand that only a few threads were enough to trigger severe performance degradation.<\/p>\n<p>This case study is clearly showing the importance of proper capacity planning and Java heap analysis, including the memory retained from your active application &amp; Java EE container threads.<\/p>\n<h2>Learning is experience. Everything else is just information<br \/>\n<\/h2>\n<p>I hope this article has helped you understand how you can pinpoint the Java heap memory footprint retained by your active threads by combining thread dump and heap dump analysis. Now, this article will remain just words if you don\u2019t experiment so I highly recommend that you take some time to learn this analysis process yourself for your application(s).<br \/>\n&nbsp;<\/p>\n<p><strong><em>Reference: <\/em><\/strong><a href=\"http:\/\/javaeesupportpatterns.blogspot.com\/2012\/12\/java-thread-retained-memory-analysis.html\">Java Thread: retained memory analysis<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Pierre-Hugues Charbonneau at the <a href=\"http:\/\/javaeesupportpatterns.blogspot.com\/\">Java EE Support Patterns &amp; Java Tutorial<\/a> blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will provide you with a tutorial allowing you to determine how much and where Java heap space is retained from your active application Java threads. A true case study from an Oracle Weblogic 10.0 production environment will be presented in order for you to better understand the analysis process. We will also attempt &hellip;<\/p>\n","protected":false},"author":189,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[207,598],"class_list":["post-6238","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-jvm","tag-troubleshooting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java Thread: retained memory analysis<\/title>\n<meta name=\"description\" content=\"This article will provide you with a tutorial allowing you to determine how much and where Java heap space is retained from your active application Java\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Thread: retained memory analysis\" \/>\n<meta property=\"og:description\" content=\"This article will provide you with a tutorial allowing you to determine how much and where Java heap space is retained from your active application Java\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-12-31T20:00:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Pierre Hugues Charbonneau\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/PHCharbonneau\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pierre Hugues Charbonneau\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html\"},\"author\":{\"name\":\"Pierre Hugues Charbonneau\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/866904c8ea3551dbbb464ce6bbb17035\"},\"headline\":\"Java Thread: retained memory analysis\",\"datePublished\":\"2012-12-31T20:00:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html\"},\"wordCount\":1304,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"JVM\",\"Troubleshooting\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html\",\"name\":\"Java Thread: retained memory analysis\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2012-12-31T20:00:12+00:00\",\"description\":\"This article will provide you with a tutorial allowing you to determine how much and where Java heap space is retained from your active application Java\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/java-thread-retained-memory-analysis.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Java Thread: retained memory analysis\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/866904c8ea3551dbbb464ce6bbb17035\",\"name\":\"Pierre Hugues Charbonneau\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/41ce66b642ba516e85800d6b0a9e81b901463fea1fbc6bd6646d58cf2a215e10?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/41ce66b642ba516e85800d6b0a9e81b901463fea1fbc6bd6646d58cf2a215e10?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/41ce66b642ba516e85800d6b0a9e81b901463fea1fbc6bd6646d58cf2a215e10?s=96&d=mm&r=g\",\"caption\":\"Pierre Hugues Charbonneau\"},\"description\":\"Pierre-Hugues Charbonneau (nickname P-H) is working for CGI Inc. Canada for the last 10 years as a senior IT consultant. His primary area of expertise is Java EE, middleware &amp; JVM technologies. He is a specialist in production system troubleshooting, root cause analysis, middleware, JVM tuning, scalability and capacity improvement; including internal processes improvement for IT support teams. P-H is the principal author at Java EE Support Patterns.\",\"sameAs\":[\"http:\\\/\\\/javaeesupportpatterns.blogspot.com\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/PHCharbonneau\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Pierre-Hugues-Charbonneau\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Thread: retained memory analysis","description":"This article will provide you with a tutorial allowing you to determine how much and where Java heap space is retained from your active application Java","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:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html","og_locale":"en_US","og_type":"article","og_title":"Java Thread: retained memory analysis","og_description":"This article will provide you with a tutorial allowing you to determine how much and where Java heap space is retained from your active application Java","og_url":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-12-31T20:00:12+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Pierre Hugues Charbonneau","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/PHCharbonneau","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Pierre Hugues Charbonneau","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html"},"author":{"name":"Pierre Hugues Charbonneau","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/866904c8ea3551dbbb464ce6bbb17035"},"headline":"Java Thread: retained memory analysis","datePublished":"2012-12-31T20:00:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html"},"wordCount":1304,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["JVM","Troubleshooting"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html","url":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html","name":"Java Thread: retained memory analysis","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2012-12-31T20:00:12+00:00","description":"This article will provide you with a tutorial allowing you to determine how much and where Java heap space is retained from your active application Java","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/java-thread-retained-memory-analysis.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Java Thread: retained memory analysis"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/866904c8ea3551dbbb464ce6bbb17035","name":"Pierre Hugues Charbonneau","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/41ce66b642ba516e85800d6b0a9e81b901463fea1fbc6bd6646d58cf2a215e10?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/41ce66b642ba516e85800d6b0a9e81b901463fea1fbc6bd6646d58cf2a215e10?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/41ce66b642ba516e85800d6b0a9e81b901463fea1fbc6bd6646d58cf2a215e10?s=96&d=mm&r=g","caption":"Pierre Hugues Charbonneau"},"description":"Pierre-Hugues Charbonneau (nickname P-H) is working for CGI Inc. Canada for the last 10 years as a senior IT consultant. His primary area of expertise is Java EE, middleware &amp; JVM technologies. He is a specialist in production system troubleshooting, root cause analysis, middleware, JVM tuning, scalability and capacity improvement; including internal processes improvement for IT support teams. P-H is the principal author at Java EE Support Patterns.","sameAs":["http:\/\/javaeesupportpatterns.blogspot.com\/","https:\/\/x.com\/https:\/\/twitter.com\/PHCharbonneau"],"url":"https:\/\/www.javacodegeeks.com\/author\/Pierre-Hugues-Charbonneau"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/6238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/189"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=6238"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/6238\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=6238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=6238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=6238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}