http://www.samaxes.com/2007/10/classloader-leaks-and-permgen-space/


   1. start your application server
   2. deploy and run your application
   3. undeploy the application that is leaking (just the application not the
   server)
   4. trigger a memory dump jmap -dump:format=b,file=leak <PID>
   5. run jhat (with modification, *Java SE SDK 6.0 update 1 has the updated
   code*) jhat -J-Xmx512m leak
   6. go to jhat report http://localhost:7000/
(http://localhost:7000/oql/if you need the
   *OQL* (Object Query Language))
   7. find a leaked class (any class of your application since you shouldn’t
   see any objects of the classes that you deployed)
   8. locate the Classloader
   9. find the “Reference chains from root set”
   10. inspect the chains, locate the accidental reference, and fix the code



-- 
*Afkham Azeez*
Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
*
*
*Member; Apache Software Foundation;
**http://www.apache.org/*<http://www.apache.org/>
*
email: **az...@wso2.com* <az...@wso2.com>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
_______________________________________________
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to