Announcement Announcement Module
No announcement yet.
Thread(WeakReferenceMonitor) in EJB causing Memory leak Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Thread(WeakReferenceMonitor) in EJB causing Memory leak

    I have been searching memory leaks almost month now and recently I made some interesting discovery.

    Lets say I have:
    Application A (simple webApp packaged to EAR)
    Hibernate 3.2.something
    Spring 2.0.8
    Weblogic 10.something
    Sun jdk 1.5

    Application B (A stateful session EJB application)
    Spring 2.0.8
    Hibernate 3.2
    Weblogic 10
    Sun jdk 1.5

    now on first ejb call from A to B causing troubles.
    First Application B starts new Thread (WeakReferenceMonitor)
    For some reasons this Thread have reference to EJB implementation (Through inheritableThreadLocals field) And because that referenceQueue never gets weakReference object. So Thread never gets killed.

    Secondly This same thread have also reference to application A classloader (weird!?) through inheritedAccessControlContext(thread field) -> context -> protection domain (location: ejb client jar) -> Application A classloader.

    So what i want to say is that. cause WeakReference monitor never stops this reference to App A never disappears. And neather App A's or App B's classloaders get garbage collected.

    Can Anyone confirm this?

    Last edited by Raino; Dec 12th, 2008, 02:30 AM.