Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Possible memory leak in com.sun.xml.bind.v2.ClassFactory #563

Closed
@glassfishrobot

Description

@glassfishrobot

Hi,

We have a JAX-WS 2.0 based web service endpoint deployed on a Java EE
Application server. This web service endpoint is packaged in a .war file and
deployed. After few deployment and undeployment cycles we see that the
application classloader doesn't get garbage collected.

After profiling the application we figured out that JAXB 2.0's
com.sun.xml.bind.v2.ClassFactory has a threadlocal which keeps a WeakHashMap
with Class object as the key and its Constructor as the value. Since the
Constructor has an implicit reference to Class object, the key(Class object)
would never get GC'ed and hence the Application Classloader.

Since, in an Application server the Web worker threads are pooled, threadlocal
entries would remain throughout the run resulting in a leak.

Environment

Operating System: All
Platform: All

Affected Versions

[2.0.5]

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions