{"id":971,"date":"2012-03-27T21:32:00","date_gmt":"2012-03-27T21:32:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/websphere-classloader-memory-leak-prevention.html"},"modified":"2012-10-21T23:09:51","modified_gmt":"2012-10-21T23:09:51","slug":"websphere-classloader-memory-leak","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html","title":{"rendered":"WebSphere Classloader Memory Leak Prevention"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">\n<div dir=\"ltr\" style=\"text-align: left\"><strong><span class=\"Apple-style-span\" style=\"font-size: large\">Solving Application ClassLoader Leaks<\/span><\/strong><\/p>\n<p><strong>Applications<span class=\"Apple-style-span\"> <\/span><\/strong><span class=\"Apple-style-span\">tend to want to:<\/span><\/div>\n<ul style=\"text-align: -webkit-auto\">\n<li>Start new threads using&nbsp;<tt>Runnable<\/tt>&nbsp;implementations from the application class loader. Even though the JEE programming model does not support this, customers frequently either directly create new threads or indirectly create them by using&nbsp;<tt><\/tt><tt><a href=\"http:\/\/java.sun.com\/javase\/6\/docs\/api\/java\/util\/Timer.html\">Timer<\/a><\/tt>s. Customers must ensure that these threads are stopped when the corresponding application (or WAR module) is stopped:\n<ul>\n<li><tt>javax.servlet.ServletContextListener.contextDestroyed<\/tt>&nbsp;can be used to be notified when a WAR is being stopped in order to clean up. Note that WARs can be stopped independently from an application when&nbsp;<a href=\"http:\/\/publib.boulder.ibm.com\/infocenter\/wasinfo\/v6r1\/topic\/com.ibm.websphere.nd.multiplatform.doc\/info\/ae\/ae\/urun_rapp_classload.html\">class reloading<\/a>&nbsp;is enabled.<\/li>\n<li><tt>javax.ejb.Singleton<\/tt>,&nbsp;<tt>javax.ejb.Startup<\/tt>, and&nbsp;<tt>javax.annotation.PreDestroy<\/tt>&nbsp;annotations can be used to be notified when an EJB module is being stopped in order to clean it up. Note, singleton EJBs are only available in EJB 3.1 (WAS v8).<\/li>\n<li><a href=\"http:\/\/publib.boulder.ibm.com\/infocenter\/wasinfo\/v6r1\/topic\/com.ibm.websphere.ejbfep.multiplatform.doc\/info\/ae\/asyncbns\/tasks\/tasb_confstb.html\">Startup beans<\/a>&nbsp;can be used to be notified when an EJB module is being stopped in order to clean up. All EJB modules are stopped when an entire application is being stopped.<\/li>\n<\/ul>\n<\/li>\n<li>Use&nbsp;<tt>ThreadLocal<\/tt>&nbsp;(storing a&nbsp;<tt>ThreadLocal<\/tt>&nbsp;in a&nbsp;<tt>static<\/tt>).&nbsp;<tt>ThreadLocal<\/tt>&nbsp;values are effectively stored as&nbsp;<tt>WeakHashMap<\/tt>&nbsp;in each&nbsp;<tt>Thread<\/tt>. Since the values typically include application objects, the application object references its&nbsp;<tt>Class<\/tt>, which references its&nbsp;<tt>ClassLoader<\/tt>, which references the&nbsp;<tt>Class<\/tt>&nbsp;contain the&nbsp;<tt>ThreadLocal<\/tt>, the weak reference is never broken, and a leak occurs.\n<p>Customers are encouraged either to&nbsp;<a href=\"http:\/\/www.devwebsphere.com\/devwebsphere\/2005\/06\/dont_use_thread.html\">avoid the use<\/a>&nbsp;of&nbsp;<tt>ThreadLocal<\/tt>, to clear references to the ThreadLocal when the module is stopped (see above), or to ensure that&nbsp;<tt><a href=\"http:\/\/java.sun.com\/javase\/6\/docs\/api\/java\/lang\/ThreadLocal.html#remove()\">remove()<\/a><\/tt>&nbsp;is called after every request.<\/li>\n<li>Register JMX MBeans or&nbsp;<tt><a href=\"http:\/\/java.sun.com\/javase\/6\/docs\/api\/javax\/management\/NotificationListener.html\">NotificationListener<\/a><\/tt>&nbsp;with the JMX server. Customers must ensure that these are unregistered when the corresponding application (or WAR module) is stopped.<\/li>\n<\/ul>\n<p><span class=\"Apple-style-span\" style=\"font-size: 19px;font-weight: bold\">Arbitrary components<\/span><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<div style=\"text-align: -webkit-auto\">This includes JDBC providers, third-party software, and applications themselvestend to want to:<\/div>\n<ul style=\"text-align: -webkit-auto\">\n<li>Start new threads, including the &#8220;timer threads&#8221; created by the&nbsp;<tt>java.util.Timer<\/tt>&nbsp;constructor. When a&nbsp;<tt>Thread<\/tt>&nbsp;is created, two pieces of information are copied from the primordial thread:\n<ol>\n<li>The context class loader (<tt><a href=\"http:\/\/java.sun.com\/javase\/6\/docs\/api\/java\/lang\/Thread.html#getContextClassLoader()\">getContextClassLoader()<\/a><\/tt>). When an application is executing, the containers set the context class loader to the module class loader, so the newly created thread will keep the context class loader alive for the duration of its existence. This can be avoided by calling&nbsp;<tt><a href=\"http:\/\/java.sun.com\/javase\/6\/docs\/api\/java\/lang\/Thread.html#setContextClassLoader(java.lang.ClassLoader)\">setContextClassLoader<\/a><\/tt>&nbsp;to a non-application class loader prior to starting the timer and then resetting it afterwards.<\/li>\n<li>The&nbsp;<tt>AccessControlContext<\/tt>&nbsp;of the calling thread (as documented by&nbsp;<tt><a href=\"http:\/\/java.sun.com\/javase\/6\/docs\/api\/java\/security\/AccessController.html\">AccessController<\/a><\/tt>). If the thread is being started due to an API call from an application, then the application&#8217;s&nbsp;<tt>ProtectionDomain<\/tt>&nbsp;will be in the<tt>AccessControlContext<\/tt>, and the&nbsp;<tt>ProtectionDomain<\/tt>&nbsp;of an application class will include a reference to its&nbsp;<tt>ClassLoader<\/tt>. This can be avoided by creating the thread using&nbsp;<tt><a href=\"http:\/\/java.sun.com\/javase\/6\/docs\/api\/java\/security\/AccessController.html#doPrivileged(java.security.PrivilegedAction)\">doPrivileged<\/a><\/tt>. Note that care must be taken to ensure that the use of&nbsp;<tt>doPrivileged<\/tt>&nbsp;does not allow unprivileged applications to create threads.<br \/>\n<span class=\"Apple-style-span\" style=\"color: green;font-family: serif\"><strong><br \/>\n<\/strong><\/span><\/li>\n<\/ol>\n<p>For example:<\/p>\n<pre class=\"brush:java\">\/\/ doPrivileged fixes the AccessControlContext leak, and it is also required\r\n\/\/ for calls to Thread.get\/setContextClassLoader.\r\nTimer timer = AccessController.doPrivileged(new PrivilegedAction() {\r\n  public void run() {\r\n    Thread thread = Thread.currentThread();\r\n    ClassLoader savedCL = thread.getContextClassLoader();\r\n    thread.setContextClassLoader(null);\r\n    try {\r\n      \/\/ The Timer constructor will create a Thread, which will copy the\r\n      \/\/ context class loader from the current thread, which is now null.\r\n      return new Timer(true);\r\n    } finally {\r\n      thread.setContextClassLoader(savedCL);\r\n    }\r\n  }\r\n});\r\n<\/pre>\n<\/li>\n<li>Associate data with the current context class loader. This is typically done via a&nbsp;<tt>Map&lt;classloader<i>Value&gt;&lt;\/classloader<i><\/tt>. This&nbsp;<tt>Map<\/tt>&nbsp;must either:<\/li>\n<\/ul>\n<ul style=\"text-align: -webkit-auto\">\n<ol>\n<li>Have explicit lifecycle APIs. In this case, the lifecycle API must be called. If the code was introduced by a customer, then the customer is responsible for adding a JMX listener. If the code was introduced by a WAS prereq, then the owner must use a WAS application listener API. If the code belongs to the JDK, then the runtime team will accept responsibility for calling it (e.g.,&nbsp;<tt><a href=\"http:\/\/java.sun.com\/javase\/6\/docs\/api\/java\/util\/ResourceBundle.html#clearCache(java.lang.ClassLoader)\">ResourceBundle.clearCache<\/a><\/tt>&nbsp;and<tt><a href=\"http:\/\/java.sun.com\/javase\/6\/docs\/api\/java\/beans\/Introspector.html#flushCaches()\">Introspector.flushCaches<\/a><\/tt>).<\/li>\n<li>Be a&nbsp;<tt>WeakHashMap<\/tt>&nbsp;to allow the&nbsp;<tt>ClassLoader<\/tt>&nbsp;key to be garbage collected. Note that the value must not hold a non-weak reference to classes or objects created from that&nbsp;<tt>ClassLoader<\/tt>, or the entry will never be removed.&nbsp;Either WeakHashMap&lt;ClassLoader, WeakReference&lt;Class&gt;&gt; or WeakHashMap&lt;ClassLoader, Tuple&gt;, where Tuple contains WeakReference&lt;Class&gt; and WeakReference&lt;Object&gt; to an object instantiated from the class. In both cases, the Class is held weakly, which will still allow the ClassLoader to be collected. In the latter case, the reference to the instantiated object will be cleared if a GC occurs, but the assumption is made that it can be cheaply reinstantiated.<\/li>\n<\/ol>\n<\/ul>\n<div style=\"text-align: -webkit-auto\"><i><br \/>\n<i>These tips are courtesy of WAS guru <strong>Brett Kail<\/strong><\/i><\/i><\/div>\n<p><strong>Reference: <\/strong><a href=\"http:\/\/wasdynacache.blogspot.com\/2012\/01\/websphere-classloader-memory-leak.html\">WebSphere Classloader Memory Leak Preventions<\/a>&nbsp;from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a><span class=\"Apple-style-span\" style=\"font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif\"><span class=\"Apple-style-span\" style=\"font-size: 14px;line-height: 18px\"><strong>&nbsp;<\/strong><\/span><\/span>Rohit Kelapure at the&nbsp;<a href=\"http:\/\/wasdynacache.blogspot.com\/\">All Things WebSphere<\/a>&nbsp;blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Solving Application ClassLoader Leaks Applications tend to want to: Start new threads using&nbsp;Runnable&nbsp;implementations from the application class loader. Even though the JEE programming model does not support this, customers frequently either directly create new threads or indirectly create them by using&nbsp;Timers. Customers must ensure that these threads are stopped when the corresponding application (or WAR &hellip;<\/p>\n","protected":false},"author":185,"featured_media":137,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[386],"class_list":["post-971","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-ibm-websphere"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WebSphere Classloader Memory Leak Prevention - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Solving Application ClassLoader Leaks Applications tend to want to:Start new threads using&nbsp;Runnable&nbsp;implementations from the application class\" \/>\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\/03\/websphere-classloader-memory-leak.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WebSphere Classloader Memory Leak Prevention - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Solving Application ClassLoader Leaks Applications tend to want to:Start new threads using&nbsp;Runnable&nbsp;implementations from the application class\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.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-03-27T21:32:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T23:09:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/ibm-websphere-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=\"Rohit Kelapure\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rohit Kelapure\" \/>\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\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html\"},\"author\":{\"name\":\"Rohit Kelapure\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/1c802ca5b7b9d47875cb6627ab777af0\"},\"headline\":\"WebSphere Classloader Memory Leak Prevention\",\"datePublished\":\"2012-03-27T21:32:00+00:00\",\"dateModified\":\"2012-10-21T23:09:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html\"},\"wordCount\":775,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/ibm-websphere-logo.jpg\",\"keywords\":[\"IBM WebSphere\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html\",\"name\":\"WebSphere Classloader Memory Leak Prevention - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/ibm-websphere-logo.jpg\",\"datePublished\":\"2012-03-27T21:32:00+00:00\",\"dateModified\":\"2012-10-21T23:09:51+00:00\",\"description\":\"Solving Application ClassLoader Leaks Applications tend to want to:Start new threads using&nbsp;Runnable&nbsp;implementations from the application class\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/ibm-websphere-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/ibm-websphere-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/03\\\/websphere-classloader-memory-leak.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\":\"WebSphere Classloader Memory Leak Prevention\"}]},{\"@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\\\/1c802ca5b7b9d47875cb6627ab777af0\",\"name\":\"Rohit Kelapure\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d0a9c86a24e278edf3de5e932faeda63b1c656a8662a64060d0625277c68bff?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d0a9c86a24e278edf3de5e932faeda63b1c656a8662a64060d0625277c68bff?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d0a9c86a24e278edf3de5e932faeda63b1c656a8662a64060d0625277c68bff?s=96&d=mm&r=g\",\"caption\":\"Rohit Kelapure\"},\"sameAs\":[\"http:\\\/\\\/wasdynacache.blogspot.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Rohit-Kelapure\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WebSphere Classloader Memory Leak Prevention - Java Code Geeks","description":"Solving Application ClassLoader Leaks Applications tend to want to:Start new threads using&nbsp;Runnable&nbsp;implementations from the application class","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\/03\/websphere-classloader-memory-leak.html","og_locale":"en_US","og_type":"article","og_title":"WebSphere Classloader Memory Leak Prevention - Java Code Geeks","og_description":"Solving Application ClassLoader Leaks Applications tend to want to:Start new threads using&nbsp;Runnable&nbsp;implementations from the application class","og_url":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-03-27T21:32:00+00:00","article_modified_time":"2012-10-21T23:09:51+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/ibm-websphere-logo.jpg","type":"image\/jpeg"}],"author":"Rohit Kelapure","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Rohit Kelapure","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html"},"author":{"name":"Rohit Kelapure","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/1c802ca5b7b9d47875cb6627ab777af0"},"headline":"WebSphere Classloader Memory Leak Prevention","datePublished":"2012-03-27T21:32:00+00:00","dateModified":"2012-10-21T23:09:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html"},"wordCount":775,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/ibm-websphere-logo.jpg","keywords":["IBM WebSphere"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html","url":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html","name":"WebSphere Classloader Memory Leak Prevention - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/ibm-websphere-logo.jpg","datePublished":"2012-03-27T21:32:00+00:00","dateModified":"2012-10-21T23:09:51+00:00","description":"Solving Application ClassLoader Leaks Applications tend to want to:Start new threads using&nbsp;Runnable&nbsp;implementations from the application class","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/ibm-websphere-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/ibm-websphere-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/03\/websphere-classloader-memory-leak.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":"WebSphere Classloader Memory Leak Prevention"}]},{"@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\/1c802ca5b7b9d47875cb6627ab777af0","name":"Rohit Kelapure","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1d0a9c86a24e278edf3de5e932faeda63b1c656a8662a64060d0625277c68bff?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1d0a9c86a24e278edf3de5e932faeda63b1c656a8662a64060d0625277c68bff?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1d0a9c86a24e278edf3de5e932faeda63b1c656a8662a64060d0625277c68bff?s=96&d=mm&r=g","caption":"Rohit Kelapure"},"sameAs":["http:\/\/wasdynacache.blogspot.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Rohit-Kelapure"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/971","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\/185"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=971"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/971\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/137"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}