Uploaded image for project: 'AppFormer'
  1. AppFormer
  2. AF-2452

making LRUCache configurable to avoid large memory retention

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.43.0.Final
    • None
    • None
    • None
    • 2020 Week 34-36 (from Aug 17)
    • Hide

      1. Configure no cache for KieRepositoryImpl

      <property name="kie.repository.project.cache.size" value="0"/>
      <property name="kie.repository.project.versions.cache.size" value="0"/>

      2. Start RHDM

      3. Import Mortgages example

      4. Click 'Build'

      5. Increment version and save.

        • Repeat step 4 and 5 (e.g. 1.0.0-SNAPSHOT, 1.0.1-SNAPSHOT, 1.0.2-SNAPSHOT, ...), 4 times.

      6. Capture a heap dump

      org.drools.compiler.kie.builder.impl.MemoryKieModule @ 0x6d3bd4bf0 | 64 | 198,752
      '- kModule org.drools.compiler.kie.builder.impl.KieBuilderImpl @ 0x6d3bcf280 | 64 | 279,640
      '- kieBuilder org.kie.workbench.common.services.backend.builder.core.Builder @ 0x6d3bbc4a0 | 96 | 332,600
      '- value java.util.LinkedHashMap$Entry @ 0x6d3ca3a10 | 40 | 337,272
      '- head org.guvnor.common.services.backend.cache.LRUCache$1 @ 0x6cf7e7048 | 64 | 49,219,936
      '- m java.util.Collections$SynchronizedMap @ 0x6cf7e7028 | 32 | 49,219,968
      '- cache org.kie.workbench.common.services.backend.builder.core.LRUBuilderCache @ 0x6cf7e6ff0| 56 | 49,220,048

      Show
      1. Configure no cache for KieRepositoryImpl <property name="kie.repository.project.cache.size" value="0"/> <property name="kie.repository.project.versions.cache.size" value="0"/> 2. Start RHDM 3. Import Mortgages example 4. Click 'Build' 5. Increment version and save. Repeat step 4 and 5 (e.g. 1.0.0-SNAPSHOT, 1.0.1-SNAPSHOT, 1.0.2-SNAPSHOT, ...), 4 times. 6. Capture a heap dump org.drools.compiler.kie.builder.impl.MemoryKieModule @ 0x6d3bd4bf0 | 64 | 198,752 '- kModule org.drools.compiler.kie.builder.impl.KieBuilderImpl @ 0x6d3bcf280 | 64 | 279,640 '- kieBuilder org.kie.workbench.common.services.backend.builder.core.Builder @ 0x6d3bbc4a0 | 96 | 332,600 '- value java.util.LinkedHashMap$Entry @ 0x6d3ca3a10 | 40 | 337,272 '- head org.guvnor.common.services.backend.cache.LRUCache$1 @ 0x6cf7e7048 | 64 | 49,219,936 '- m java.util.Collections$SynchronizedMap @ 0x6cf7e7028 | 32 | 49,219,968 '- cache org.kie.workbench.common.services.backend.builder.core.LRUBuilderCache @ 0x6cf7e6ff0| 56 | 49,220,048
    • NEW
    • NEW

      The current appformer hard codes 20 entries for the LRUCache [1].

      This results in the retention of org.drools.compiler.kie.builder.impl.MemoryKieModule class in the LRUBuilderCache when building a project with incremental versions.

      The following is one test for building a project:

      0.6g - before the build.
      1.3g - after the 1st build + full GC
      1.9g - after the 2nd build + full GC (change the version number)
      1.9g - after the 3rd build + full GC (without changing the version number)
      2.5g - after the 4th build + full GC (change the version number)
      3.1g - after the 5th build + full GC (change the version number)

      One suggestion is to make the LRUCache configurable instead of hard coding 20 for the entries.

      [1] https://github.com/kiegroup/appformer/blob/master/uberfire-services/uberfire-services-api/src/main/java/org/guvnor/common/services/backend/cache/LRUCache.java#L30-L37

            abkuma abhishek kumar
            rhn-support-ghu Gary Hu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: