Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1067841

Summary: Compiled resource objects leak in KnowledgeAgentImpl.registeredResources
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Toshiya Kobayashi <tkobayas>
Component: BRE (Expert, Fusion)Assignee: Nobody <nobody>
Status: CLOSED UPSTREAM QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.1   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:35:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Toshiya Kobayashi 2014-02-21 07:23:31 UTC
Description of problem:

Conditions:
- ChangeSet which points at a directory for DRL files
- Those DRL files have rules for the same package
- newInstance=true

KnowledgeAgentImpl.registeredResources has entries for each DRL files under the directory and holds org.drools.rule.Rule objects which lead to compiled resource objects like org.mvel2.compiler.CompiledExpression, org.drools.rule.DialectRuntimeRegistry etc.

When one DRL file in the directory is updated, the package and kbase is fully updated and the entry in KnowledgeAgentImpl.registeredResources is updated as well. But other entries still retain old org.drools.rule.Rule objects hence related compiled resource objects will not be garbage collected (I believe they are not needed. Correct me if I'm wrong).


Steps to Reproduce:
1. Have a ChangeSet which points at a directory for DRL files
2. Those DRL files have rules for the same package
3. Keep updating different DRL files one by one and let KnowledgeAgent detect one by one

Actual results:

Memory usage keeps growing

Expected results:

Memory usage doesn't keep growing

Additional info:

Comment 1 Toshiya Kobayashi 2014-02-21 07:32:50 UTC
Sent a pull request as a test case for 5.6.x branch

https://github.com/droolsjbpm/drools/pull/316

Comment 2 Lukáš Petrovický 2014-02-21 11:52:48 UTC
*** Bug 1067843 has been marked as a duplicate of this bug. ***

Comment 3 Toshiya Kobayashi 2014-03-05 02:05:58 UTC
There are 2 workarounds:

A. Update the timestamp of all files under the directory which changeset looks at so KnowledgeAgentImpl.registeredResources will be fully updated.

B. Use newInstance=false for KnowledgeAgent.

https://access.redhat.com/site/solutions/744313

Comment 7 Red Hat Bugzilla 2025-02-10 03:35:09 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.