[
https://issues.jboss.org/browse/DROOLS-1371?page=com.atlassian.jira.plugi...
]
Bill Tuminaro commented on DROOLS-1371:
---------------------------------------
After looking at the Drools source code, I see why there are 2 classloaders for each
rule.
Here is the object graph for the 2 classloaders per rule with variable names and class
names:
1) kContainer (KieContainerImpl)
kBases (ConcurrentHashMap)
segments (ConcurrentHashMap$Segment)
segment[3]
value (KnowledgeBaseImpl)
pkgs (HashMap)
value (DialectRuntimeRegistry)
value( JavaDialectRuntimeData)
classloader (JavaDialectRuntimeData$PackageClassLoader)
2) (KieRepositoryImpl)
kieModuleRepo (KieRepositoryImpl$KieModuleRepo)
kieModules (ConcurrentHashMap)
segments
table [0] (ConcurrentHashMap$HashEntry)
value (TreeMap)
kBuilders(HashMap)
entrySet (HashMap$EntrySet)
table [1] (HashMap$Entry)
value (KnowledgeBuilderImp)
continued ============> pkgRegistryMap (LinkedHashMap)
values (HashMap$Values)
this$0 (LinkedHashMap)
table (Hashmap$Entry)
[5] (LinkedHashMap$Entry)
value (PackageRegistry)
dialectCompiletimeRegistry (DialectCompiletimeRegistry)
map (HashMap)
[10] (HashMap$Entry)
value (JavaDialect)
packageStoreWrapper (PackageStore)
javaDialectRuntimeData (JavaDialectRuntimeData)
continued ============> classloader (JavaDialectRuntimeData$PackageClassLoader)
I will close this request as it appears to be working as designed.
-BillT
Too many classloaders use too much memory for a large rule set
--------------------------------------------------------------
Key: DROOLS-1371
URL:
https://issues.jboss.org/browse/DROOLS-1371
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 6.3.0.Final
Reporter: Bill Tuminaro
Assignee: Mario Fusco
Attachments: WhyTwoClassoaders.java, drools-1371.PNG
Why are there so many classloaders after I create a KieSession for a KieFileSystem and
KieContainer that only contains one rule?
The extra classloaders for each rule are consuming too much memory for a rule set that
contains several thousand rules.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)