Hi Magnus,<br><br>thanks for having reported this. What you found is quite interesting and I will give a look at this issue asap.<br>In the meanwhile it would be great if you could open a ticket about it here: <a href="https://issues.jboss.org/browse/DROOLS">https://issues.jboss.org/browse/DROOLS</a><br>
<br>Thanks again and regards,<br>Mario<br><br><div class="gmail_quote">On Mon, Feb 11, 2013 at 10:56 AM, Magnus Vojbacke <span dir="ltr">&lt;<a href="mailto:magnus.vojbacke@digitalroute.com" target="_blank">magnus.vojbacke@digitalroute.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I run into memory issues when using marshaling or unmarshalling Drools stateful sessions.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I was going to send this to rules-users, but I think the content is too technical and implementation oriented to fit into that list.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">It seems that the memory consumption increases after a session has been unmarshalled. That is to say: an unmarshalled session of size x uses  much more memory than if I had started with an empty session and inserted x number of facts.<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Digging into a memory profile, I found that after unmarshalling, my ReteooStatefulSession instance holds on to a MarshallerReaderContext instance. The MarshallerReaderContext consumes a lot of memory.<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Digging into the unmarshalling code, it seems that the MarshallerReaderContext is a utility class used during unmarshalling of sessions. Intuitively, it seems wrong that a reference to this object should be held after unmarshalling is finished.<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is this a bug in Drools? Would it be ok if I filed this as an issue at the Drools issue repository?<u></u><u></u></p>
</div>
</div>

<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br></blockquote></div><br>