Metaspace OOME from leaked sun.reflect.DelegatingClassloaders in SerializableClassRegistry

Solution Unverified - Updated -

Issue

  • We reach an OOME on EAP 7.0 with many DelegatingClassLoaders. The heap dump shows these retained under a SerializableClassRegistry map:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
registry org.jboss.marshalling.reflect.SerializableClassRegistry @ 0x6c0ba9628                                                     |       34,524 |           16 |         2,209,536 |    54,596,392
'- registry org.jboss.marshalling.reflect.UnlockedHashMap @ 0x6c0ba9638                                                            |       34,524 |           48 |         2,209,536 |    54,596,376
   '- table org.jboss.marshalling.reflect.UnlockedHashMap$Table @ 0x6c0ba9668                                                      |       34,524 |           32 |         2,209,536 |    54,596,280
      '- array java.lang.Object[512] @ 0x6c0ba9688                                                                                 |       34,524 |        2,064 |         2,209,536 |    54,596,248
         |- [258] org.jboss.marshalling.reflect.UnlockedHashMap$Item[1] @ 0x6c32dc9c0                                              |       34,414 |           24 |         2,202,496 |    54,361,920
         |  '- [0] org.jboss.marshalling.reflect.UnlockedHashMap$Item @ 0x6c32dc9d8                                                |       34,414 |           24 |         2,202,496 |    54,361,896
         |     '- value org.jboss.marshalling.reflect.UnlockedHashMap @ 0x6c16faa70                                                |       34,414 |           48 |         2,202,496 |    54,361,872
         |        '- table org.jboss.marshalling.reflect.UnlockedHashMap$Table @ 0x6cb50cbc0                                       |       34,414 |           32 |         2,202,496 |    54,361,776
         |           '- array java.lang.Object[65536] @ 0x6cb50cbe0                                                                |       34,414 |      262,160 |         2,202,496 |    54,361,744
         |              |- [48843] org.jboss.marshalling.reflect.UnlockedHashMap$Item[6] @ 0x6cfeab8a0                             |            6 |           40 |               384 |         9,352
         |              |  |- [5] org.jboss.marshalling.reflect.UnlockedHashMap$Item @ 0x6cfeab8c8                                 |            1 |           24 |                64 |         1,552
         |              |  |  '- value org.jboss.marshalling.reflect.SerializableClass @ 0x6cfeab8e0                               |            1 |           64 |                64 |         1,528
         |              |  |     '- nonInitConstructor java.lang.reflect.Constructor @ 0x6cfeab9d0  public java.lang.Object()      |            1 |           80 |                64 |           696
         |              |  |        '- constructorAccessor sun.reflect.GeneratedSerializationConstructorAccessor64829 @ 0x6cfeaba40|            1 |           16 |                64 |           584
         |              |  |           '- <class> class sun.reflect.GeneratedSerializationConstructorAccessor64829 @ 0x6d08f73e0   |            1 |            0 |                64 |           568
         |              |  |              '- <classloader> sun.reflect.DelegatingClassLoader @ 0x6d08f7380                         |            1 |           64 |                64 |           568
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Environment

  • JBoss Enterprise Application Platform (EAP) 7.0.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In