0

I have read a lot of post (like this, this, this) and they suggests that JAXBContext.newInstance caused memory leak, now my understanding is that once method execution is over, all local objects created inside the method will be eligible for GC, so I wonder that how JAXBContext.newInstance caused memory.

pjj
  • 2,015
  • 1
  • 17
  • 42

1 Answers1

0

One of the reasons is that JAXB runtime uses ThreadLocal here and there, sometimes static. This may be a source of memory leaks:

ThreadLocal & Memory Leak

lexicore
  • 42,748
  • 17
  • 132
  • 221