2

An application running under Weblogic 12c makes extremely heavy but temporary use of PermGen space during a late phase of startup. I say "temporary" because it exhibits "saw-tooth" growth up to the PermGen limit (500MB), then instantly dropping down to a nearly-constant base level (around 300MB), graphing like this: /|/|/| . After about 5 lengthy iterations, normal startup resumes.

Running with "-verbose:class" turned on, we see no classes being loaded or unloaded during this behavior.

What usage of PermGen might exhibit this set of symptoms? All I can think is that for some unknown reason, around a gigabyte of interned strings are being created and then garbage-collected.

Update This is running on Solaris HotSpot 1.7. Strings aren't interned in Java 7.

Update 2 This appears to be an issue with trying to load the classes being handled by a ServletContextInitializer, probably WebLogic-specific. We don't have any ServletContextInitializers, nor do any of our libs - it must be part of the base WebLogic classloader space. There are a lot in there. I'd guess that there's a bug in error-handling of NoClassDefFound for a base class, interface, or annotation used by some class that the @HandlesTypes on the ServletContextInitializer is flagging.

Community
  • 1
  • 1
Ed Staub
  • 15,480
  • 3
  • 61
  • 91
  • What libraries/frameworks does your app use? – BillRobertson42 Nov 04 '13 at 15:43
  • Feasibly something that is doing a whole bunch of runtime class instrumentation via a library like javassist or something using unusual string interning behaviour. This may also be an affect of your jvm if you're using a non-standard one, though I've not seen any do that. – Taylor Nov 04 '13 at 15:49
  • @Bill, it's a very large app with dozens of dependencies. The only thing that I'm aware of that creates classes dynamically is JAXB. Similarly, the only lib in use that I know does a lot of interning is JAXP (Xerces). There's no Hibernate. To reverse your question... What libs/frameworks would raise a flag with you, and why? – Ed Staub Nov 04 '13 at 16:10
  • @Taylor, I thought of runtime instrumentation and JIT-compilation, but in both cases, I'd expect the allocation to be permanent - not just created and then released in PermGen space. – Ed Staub Nov 04 '13 at 16:12
  • It can happen if a classloader is used during startup and then discarded, IIRC. Again this is all heavily dependent on the JVM. – Taylor Nov 04 '13 at 16:17
  • @Taylor, wouldn't that be logged by -verbose:class? This is HotSpot/Solaris. – Ed Staub Nov 04 '13 at 16:27
  • The Java-based Rhino JavaScript engine has an "as designed" permgen leak when run in non-interpreted mode. Just throwing ideas out there in case something sticks. – Mike Clark Nov 04 '13 at 16:55
  • @EdStaub I've used -XX:+TraceClassLoading -XX:+TraceClassUnloading in the past. – Taylor Nov 04 '13 at 18:09
  • @Taylor AFAICT `TraceClassLoading`/`TraceClassUnloading` are just finer-grained switches for `-verbose:class`. The output is identical in format. – Ed Staub Nov 04 '13 at 18:18
  • @EdStaub HAve you tried: http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/tooldescr.html#gblmm ? – Taylor Nov 04 '13 at 19:21
  • @Taylor Yeah, it just hangs. Tried big heap, googling - no joy. – Ed Staub Nov 04 '13 at 21:52

0 Answers0