0

I am running a large Java 7 application (built by Maven) which started to crash multiple times due to PermGen error. After profiling it (jProfiler) I noticed the ClassLoader section holds increasing number on ClassLoader of type: org.eclipse.persistence.internal.jaxb. JaxbClassLoader until the process is choke. I am not using EclipseLink directly but this class for sure is in the classpath due to some other transitive dependencies. 1) can anyone explain this behavior of increasing number of class loders? 2) how can I approach this problem, any idea how to use Maven to find all modules that their transitive dependencies, add this class to classpath.

Thanks, Ronen

rperez
  • 8,430
  • 11
  • 36
  • 44

1 Answers1

1

Use the dependency plugin (per this answer https://stackoverflow.com/a/6110881/116509) to see what requires it.

But that won't solve your problem, because you probably can't remove it from the classpath. I'd try googling JAXB memory leak instead (e.g. see this answer https://stackoverflow.com/a/3285931/116509)

You can also try running your application on the Java 8 JVM which abolished PermGen (but see digitaljoel's comment, below), though fixing the leak would be better.

Community
  • 1
  • 1
artbristol
  • 32,010
  • 5
  • 70
  • 103
  • While java 8 got rid of PermGen, all it really did was rename PermGen and allow it to be resized. If it's truly a leak, it'll just continue to leak, but with metaspace it'll leak until it consumes all the native memory on the machine instead of dying when hitting a PermGen size limit. Yes, you can limit the size of metaspace. I just wanted to point out that "removing permgen" isn't really a fix for anything. – digitaljoel Dec 11 '15 at 20:30