Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-13595

MP REST client causes classloader leak on undeploy

XMLWordPrintable

      I have an application that uses CDI and JAX-RS but not MP REST. The MP subsystems aren't even part of the WildFly configuration. Nonetheless, the MP REST client is added to the deployment and creates a classloader leak when the application is undeployed.

      See below for the paths to GC root, as determined using a heap dump analyzed by Eclipse MAT. In particular, note that org.jboss.resteasy.microprofile.client.RestClientExtension keeps a static reference to the CDI BeanManager.

      Workaround: add an exclusion in jboss-deployment-structure.xml to prevent the org.jboss.resteasy.resteasy-client-microprofile module from being added to the deployment.

      Class Name                                                                                                                                   | Shallow Heap | Retained Heap
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                                                                   |              |              
      com.sg.sciq.jpa.entity.QStore @ 0xfc8913f0                                                                                                   |          120 |        10,704
      '- store class com.sg.sciq.jpa.entity.QStore @ 0xe53d5af0                                                                                    |           24 |        10,816
         '- [459] java.lang.Object[5120] @ 0xe702af00                                                                                              |       20,496 |     3,166,624
            '- elementData java.util.Vector @ 0xe4677e88                                                                                           |           32 |     3,166,656
               '- classes org.jboss.modules.ModuleClassLoader @ 0xe4677208                                                                         |           88 |     3,654,184
                  '- moduleClassLoader org.jboss.as.weld.discovery.WeldClassFileServices @ 0xe4d09bb8                                              |           24 |            24
                     '- value java.util.HashMap$Node @ 0xe507ed10                                                                                  |           32 |            32
                        '- [63] java.util.HashMap$Node[128] @ 0xe4df06e8                                                                           |          528 |         2,904
                           '- table java.util.HashMap @ 0xe4df06b8                                                                                 |           48 |         2,984
                              '- services org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry @ 0xe4df06a8                                  |           16 |         3,000
                                 '- services org.jboss.weld.manager.BeanManagerImpl @ 0xe4df0610                                                   |          152 |         7,848
                                    '- manager org.jboss.weld.bean.builtin.BeanManagerProxy @ 0xe4df0c90                                           |           24 |            24
                                       '- manager class org.jboss.resteasy.microprofile.client.RestClientExtension @ 0xe4df0c20                    |            8 |            56
                                          '- [0] java.lang.Object[10] @ 0xe46ec028                                                                 |           56 |            80
                                             '- elementData java.util.Vector @ 0xe46ec008                                                          |           32 |           112
                                                '- classes org.jboss.modules.ModuleClassLoader @ 0xe46ebea8                                        |           88 |         3,240
                                                   '- moduleClassLoader org.jboss.modules.Module @ 0xe47d1348                                      |           56 |        30,296
                                                      '- module org.jboss.modules.ModuleLoader$FutureModule @ 0xe4a65790                           |           24 |            24
                                                         '- val java.util.concurrent.ConcurrentHashMap$Node @ 0xe4a65770                           |           32 |            56
                                                            '- [352] java.util.concurrent.ConcurrentHashMap$Node[512] @ 0xe08491f0                 |        2,064 |        19,088
                                                               '- table java.util.concurrent.ConcurrentHashMap @ 0xe0487188                        |           64 |        19,152
                                                                  '- moduleMap org.jboss.modules.LocalModuleLoader @ 0xe0487150                    |           56 |        22,120
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe014b580                         |           56 |         9,336
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe017c0e0                         |           56 |        58,440
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe034f7c8                         |           56 |        28,576
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe05f8e50                         |           56 |        41,160
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe06db838                         |           56 |        72,288
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe06f42e0                         |           56 |        20,720
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe0741d58                         |           56 |        56,712
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe0979ec8                         |           56 |        43,760
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe04a9200                         |           56 |        14,000
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe05c9b30                         |           56 |         8,704
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe0729200                         |           56 |        23,264
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe0941378                         |           56 |        54,360
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe032e128                         |           56 |        22,832
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe05dbaf0                         |           56 |        27,728
                                                                     |- INSTANCE class org.jboss.modules.DefaultBootModuleLoaderHolder @ 0xe065cbe0|            8 |             8
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe068b460                         |           56 |        20,008
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe0707518                         |           56 |        46,848
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe073b5e0                         |           56 |        44,880
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe0213738                         |           56 |        12,040
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe058c4f0                         |           56 |        23,424
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe02f41c8                         |           56 |        30,144
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe034f128                         |           56 |        27,088
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe0500470                         |           56 |         9,912
                                                                     |- moduleLoader org.jboss.modules.Module @ 0xe12ceea0                         |           56 |        24,648
                                                                     '- Total: 24 entries                                                          |              |              
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
       

              rhn-support-asoldano Alessio Soldano
              rdicroce Richard DiCroce (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: