Increase the heap memory, see java options such as -Xmsn and -Xmxn. See your system's documentation on java.
Do you really have to have all CashFlow objects in WorkingMemory at the same time? Consider processing your "huge file" in sections.
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.
-W
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 –
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2020)
at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:1996)
at java.util.Calendar.setTimeInMillis(Calendar.java:1109)
at java.util.GregorianCalendar.<init>(GregorianCalendar.java:576)
at java.util.Calendar.createCalendar(Calendar.java:1011)
at java.util.Calendar.getInstance(Calendar.java:948)
at CashFlowTest.main(CashFlowTest.java:66)
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.
Like below-
while ((readLine = bufferedReader.readLine()) != null) {
String transactionType = readLine.substring(13, 14);
String amount = readLine.substring(9, 12);
if ("C".equals(transactionType)) {
CashFlow wCashFlow = new CashFlow(Calendar.getInstance()
.getTime(), Double.valueOf(amount), CREDIT, 1);
memoryEntryPoint.insert(wCashFlow);
} else {
CashFlow wCashFlow = new CashFlow(Calendar.getInstance()
.getTime(), Double.valueOf(amount), DEBIT, 1);
}
}
Unless I am doing something wrong here, I conclude it entry stream cannot source GB data?
From: Aman [mailto:boy18nj@gmail.com]
Sent: Sunday, October 03, 2010 10:06 PM
To: 'Rules Users List'
Subject: RE: [rules-users] WorkingMemoryEntryPoint NullpointerException?
Now I am using it. Thanks
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Leandro Romero
Sent: Sunday, October 03, 2010 10:02 PM
To: Rules Users List
Subject: Re: [rules-users] WorkingMemoryEntryPoint NullpointerException?
Are you using that entry-point in your rules? That might be the problem.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users