Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-7000

class retention by JSONMashaller ObjectMapper._typeFactory._typeCache

    XMLWordPrintable

Details

    • 2022 Week 20-22 (from May 16)
    • 2
    • NEW
    • NEW
    • ---
    • ---

    Description

      ObjectMapper._typeFactory is a shared singleton by default. This could lead to large heap/metaspace retention especially when kjar update is involved.

      for example, Eclipse Memory Analyzer output:
      "com.example.manyrules.Rule_ManyRules_1153511144278DefaultConsequenceInvoker" -> "Marge shortest paths to GC root" -> "exclude all phantom/weak/soft etc. references"

      Class Name                                                                                                                                                                                 | Referenced Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      java.lang.Thread @ 0xcd64c5f0  drools-worker-5 Thread                                                                                                                                      |                  1 |          112 |                16 |           576
      '- contextClassLoader org.jboss.modules.ModuleClassLoader @ 0xb78590d8                                                                                                                     |                  1 |           96 |                16 |    13,415,712
         '- classes java.util.Vector @ 0xba5c1a20                                                                                                                                                |                  1 |           32 |                16 |    12,871,928
            '- elementData java.lang.Object[10240] @ 0xcbd34d88                                                                                                                                  |                  1 |       40,976 |                16 |    12,871,896
               '- [1324] class org.kie.server.services.dmn.ModelEvaluatorServiceBase @ 0xb9725a48                                                                                                |                  1 |           16 |                16 |         8,704
                  '- objectMapper com.fasterxml.jackson.databind.ObjectMapper @ 0xb9725ac0                                                                                                       |                  1 |           72 |                16 |         8,424
                     '- _typeFactory com.fasterxml.jackson.databind.type.TypeFactory @ 0xb7d0dea0                                                                                                |                  1 |           32 |                16 |   377,668,240
                        '- _typeCache com.fasterxml.jackson.databind.util.LRUMap @ 0xb7d0dec0                                                                                                    |                  1 |           24 |                16 |   377,668,192
                           '- _map java.util.concurrent.ConcurrentHashMap @ 0xb7d0ded8                                                                                                           |                  1 |           64 |                16 |   377,668,168
                              '- table java.util.concurrent.ConcurrentHashMap$Node[256] @ 0xcf963b20                                                                                             |                  1 |        1,040 |                16 |   377,668,104
                                 '- [150] java.util.concurrent.ConcurrentHashMap$Node @ 0xd90969b8                                                                                               |                  1 |           32 |                16 |           104
                                    '- key class com.example.manyrules.Fact @ 0xd5ebaa48                                                                                                         |                  1 |            8 |                16 |            32
                                       '- <classloader> org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @ 0xd449b708                                                |                  1 |           80 |                16 |   187,309,984
                                          '- projectClassLoader org.drools.dynamic.DynamicProjectClassLoader @ 0xd319f608                                                                        |                  1 |          104 |                16 |   187,306,576
                                             '- resourceProvider org.drools.compiler.kie.builder.impl.AbstractKieModule$KieModuleResourceProvider @ 0xd31a0c60                                   |                  1 |           24 |                16 |   187,293,504
                                                '- kieModule org.drools.compiler.kie.builder.impl.ZipKieModule @ 0xd560c0b8                                                                      |                  1 |           64 |                16 |   187,293,208
                                                   '- kBuilders java.util.HashMap @ 0xd1042908                                                                                                   |                  1 |           48 |                16 |    80,870,640
                                                      '- table java.util.HashMap$Node[16] @ 0xd87069e0                                                                                           |                  1 |           80 |                16 |    80,870,592
                                                         '- [3] java.util.HashMap$Node @ 0xd8706a30                                                                                              |                  1 |           32 |                16 |    80,870,512
                                                            '- value org.drools.compiler.builder.impl.KnowledgeBuilderImpl @ 0xd560bfe0                                                          |                  1 |           88 |                16 |    80,870,480
                                                               '- pkgRegistryMap java.util.concurrent.ConcurrentHashMap @ 0xd2d9d070                                                             |                  1 |           64 |                16 |    65,577,944
                                                                  '- table java.util.concurrent.ConcurrentHashMap$Node[16] @ 0xd52b7568                                                          |                  1 |           80 |                16 |    65,577,864
                                                                     '- [0] java.util.concurrent.ConcurrentHashMap$Node @ 0xd52b75b8                                                             |                  1 |           32 |                16 |    65,577,784
                                                                        '- val org.drools.compiler.compiler.PackageRegistry @ 0xd4722258                                                         |                  1 |           32 |                16 |    65,577,752
                                                                           '- pkg org.drools.core.definitions.impl.KnowledgePackageImpl @ 0xd472c848                                             |                  1 |           96 |                16 |       472,032
                                                                              '- rules java.util.LinkedHashMap @ 0xd472c8a8                                                                      |                  1 |           56 |                16 |       465,624
                                                                                 '- table java.util.HashMap$Node[16384] @ 0xd736c160                                                             |                  1 |       65,552 |                16 |        65,552
                                                                                    '- [285] java.util.LinkedHashMap$Entry @ 0xd738ce68                                                          |                  1 |           40 |                16 |            40
                                                                                       '- value org.drools.core.definitions.rule.impl.RuleImpl @ 0xd8d32f38                                      |                  1 |          128 |                16 |         2,112
                                                                                          '- consequence com.example.manyrules.Rule_ManyRules_1153511144278DefaultConsequenceInvoker @ 0xd83ac610|                  1 |           16 |                16 |            32
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: