[jboss-jira] [JBoss JIRA] (DROOLS-913) Memory leak when deleting a tuple from an unlinked segment
RH Bugzilla Integration (JIRA)
issues at jboss.org
Fri Oct 9 08:50:01 EDT 2015
[ https://issues.jboss.org/browse/DROOLS-913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116933#comment-13116933 ]
RH Bugzilla Integration commented on DROOLS-913:
------------------------------------------------
George Varsamis <gvarsami at redhat.com> changed the Status of [bug 1263496|https://bugzilla.redhat.com/show_bug.cgi?id=1263496] from MODIFIED to ON_QA
> Memory leak when deleting a tuple from an unlinked segment
> ----------------------------------------------------------
>
> Key: DROOLS-913
> URL: https://issues.jboss.org/browse/DROOLS-913
> Project: Drools
> Issue Type: Bug
> Reporter: Mario Fusco
> Assignee: Mario Fusco
> Fix For: 6.3.0.Final
>
>
> When deleting an object from a session all references to the object itself and the fact handle holding it should disappear. Unfortunately, as demonstrated by the test case below, in some case the deleted fact can remain as a deleted left tuple in the memory of an unlinked segment.
> {code}
> @Test
> public void testBetaMemoryLeakOnFactDelete() {
> String drl =
> "rule R1 when\n" +
> " $a : Integer(this == 1)\n" +
> " $b : String()\n" +
> " $c : Integer(this == 2)\n" +
> "then \n" +
> "end\n" +
> "rule R2 when\n" +
> " $a : Integer(this == 1)\n" +
> " $b : String()\n" +
> "then \n" +
> "end\n";
> KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL )
> .build()
> .newKieSession();
> FactHandle fh1 = ksession.insert(1);
> FactHandle fh2 = ksession.insert("test");
> ksession.fireAllRules();
> ksession.delete(fh1);
> ksession.delete(fh2);
> ksession.fireAllRules();
> NodeMemories nodeMemories = ((InternalWorkingMemory) ksession).getNodeMemories();
> for (int i = 0; i < nodeMemories.length(); i++) {
> Memory memory = nodeMemories.peekNodeMemory( i );
> if ( memory != null && memory.getSegmentMemory() != null ) {
> SegmentMemory segmentMemory = memory.getSegmentMemory();
> System.out.println( memory );
> LeftTuple deleteFirst = memory.getSegmentMemory().getStagedLeftTuples().getDeleteFirst();
> System.out.println( deleteFirst );
> assertNull( deleteFirst );
> }
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list