Increase the heap memory, see java options such as -Xmsn and -Xmxn. See your system's documentation on java.<br><br>Do you really have to have all CashFlow objects in WorkingMemory at the same time? Consider processing your "huge file" in sections.<br>
<br>You probably don't have to have a different Date value for each of your CashFlow transactions; the way you do it, they won't differ much anyway. Use a single shared Date object for all CashFlow objects.<br><br>
-W<br><br><div class="gmail_quote">2010/10/4 Aman <span dir="ltr"><<a href="mailto:boy18nj@gmail.com">boy18nj@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Based upon what I understood from Drools fusion documentation,
entry point stream can source data from file stream, so it could process data
in GB’s. Believe me this is not what I found, to my surprise I found out
I got –</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: red;">Exception in thread "main"
java.lang.OutOfMemoryError: Java heap space</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: red;"> at
java.util.GregorianCalendar.computeFields(</span><u><span style="font-size: 10pt; font-family: "Courier New"; color: navy;">GregorianCalendar.java:2020</span></u><span style="font-size: 10pt; font-family: "Courier New"; color: red;">)</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: red;"> at
java.util.GregorianCalendar.computeFields(</span><u><span style="font-size: 10pt; font-family: "Courier New"; color: navy;">GregorianCalendar.java:1996</span></u><span style="font-size: 10pt; font-family: "Courier New"; color: red;">)</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: red;"> at
java.util.Calendar.setTimeInMillis(</span><u><span style="font-size: 10pt; font-family: "Courier New"; color: navy;">Calendar.java:1109</span></u><span style="font-size: 10pt; font-family: "Courier New"; color: red;">)</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: red;"> at
java.util.GregorianCalendar.<init>(</span><u><span style="font-size: 10pt; font-family: "Courier New"; color: navy;">GregorianCalendar.java:576</span></u><span style="font-size: 10pt; font-family: "Courier New"; color: red;">)</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: red;"> at
java.util.Calendar.createCalendar(</span><u><span style="font-size: 10pt; font-family: "Courier New"; color: navy;">Calendar.java:1011</span></u><span style="font-size: 10pt; font-family: "Courier New"; color: red;">)</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: red;"> at
java.util.Calendar.getInstance(</span><u><span style="font-size: 10pt; font-family: "Courier New"; color: navy;">Calendar.java:948</span></u><span style="font-size: 10pt; font-family: "Courier New"; color: red;">)</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: red;"> at
CashFlowTest.main(</span><u><span style="font-size: 10pt; font-family: "Courier New"; color: navy;">CashFlowTest.java:66</span></u><span style="font-size: 10pt; font-family: "Courier New"; color: red;">)</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I am reading a huge file in while loop, inside this loop object
is being constructed and inserted into entry point stream. Before even rules
would start firing, it goes straight into exception.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Like below-</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> </span><b><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(127, 0, 85);">while</span></b><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> ((readLine =
bufferedReader.readLine()) != </span><b><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(127, 0, 85);">null</span></b><span style="font-size: 10pt; font-family: "Courier New"; color: black;">) {</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> String
transactionType = readLine.substring(13, 14);</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> String
amount = readLine.substring(9, 12);</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> </span><b><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(127, 0, 85);">if</span></b><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> (</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(42, 0, 255);">"C"</span><span style="font-size: 10pt; font-family: "Courier New"; color: black;">.equals(transactionType))
{</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> CashFlow
wCashFlow = </span><b><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(127, 0, 85);">new</span></b><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> CashFlow(Calendar.<i>getInstance</i>()</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> .getTime(),
Double.<i>valueOf</i>(amount), </span><i><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 192);">CREDIT</span></i><span style="font-size: 10pt; font-family: "Courier New"; color: black;">, 1);</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> memoryEntryPoint.insert(wCashFlow);</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> }
</span><b><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(127, 0, 85);">else</span></b><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> {</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> CashFlow
<u>wCashFlow</u> = </span><b><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(127, 0, 85);">new</span></b><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> CashFlow(Calendar.<i>getInstance</i>()</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> .getTime(),
Double.<i>valueOf</i>(amount), </span><i><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 192);">DEBIT</span></i><span style="font-size: 10pt; font-family: "Courier New"; color: black;">, 1);</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> }</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> }</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Unless I am doing something wrong here, I conclude it entry
stream cannot source GB data?</span></p>
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> Aman
[mailto:<a href="mailto:boy18nj@gmail.com" target="_blank">boy18nj@gmail.com</a>] <br>
<b>Sent:</b> Sunday, October 03, 2010 10:06 PM<br>
<b>To:</b> 'Rules Users List'<br>
<b>Subject:</b> RE: [rules-users] WorkingMemoryEntryPoint NullpointerException?</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Now I am using it. Thanks</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Leandro Romero<br>
<b>Sent:</b> Sunday, October 03, 2010 10:02 PM<br>
<b>To:</b> Rules Users List<br>
<b>Subject:</b> Re: [rules-users] WorkingMemoryEntryPoint NullpointerException?</span></p>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Are you using that entry-point in your rules? That might be
the problem.</p>
</div>
</div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>