create ... for each ... with ... - eats up memory

If you think that something doesn't work in Aware IM post your message here
Post Reply
Hubertus
Posts: 153
Joined: Sat Feb 11, 2006 2:11 pm
Location: Austria
Contact:

create ... for each ... with ... - eats up memory

Post by Hubertus »

Hello

I have a process with

Code: Select all

FIND Bestelldetail WHERE Bestelldetail.Bestellung.Tour=ThisTour
CREATE KHKExport FOR EACH Bestelldetail WITH KHKExport.Datum=Bestelldetail._Bestelldatum,KHKExport.KdNr=Bestelldetail._KundenNr,KHKExport.LKW=Bestelldetail._LKW,KHKExport.Menge=Bestelldetail.Menge,KHKExport.ProduktNr=Bestelldetail._ProduktNr,KHKExport.BestellID=Bestelldetail._BestellID,KHKExport.PositionID=Bestelldetail.ID
The BO's are related as Tour ->1:N-> Bestellung ->1:N-> Bestelldetail
Fields starting with an underscore are shortcuts.

The process itself works fine. But something eats up all my memory.
If FIND returns for example 8 Records then the default setting with 96M is to small.
When increasing -Xmx to 512M in startAwareIM.sh then 18 Records work but 28 records don't work any more.

The AwareIM log contains:

Code: Select all

2007-03-12 17:55:09,717 Reply#120    -15 Executing action FIND Bestelldetail WHERE Bestelldetail.Bestellung.Tour=ThisTour
2007-03-12 17:55:09,774 Reply#120       -33 Found 28 objects
2007-03-12 17:55:09,775 Reply#120    -16 Finished executing action FIND Bestelldetail WHERE Bestelldetail.Bestellung.Tour=ThisTour
2007-03-12 17:55:09,785 Reply#120    -15 Executing action CREATE KHKExport FOR EACH Bestelldetail WITH KHKExport.Datum=Bestelldetail._Bestelldatum,KHKExport.KdNr=Bestelldetail._KundenNr,KHKExport.LKW=Bestelldetail._LKW,KHKExport.Menge=Bestelldetail.Menge,KHKExport.ProduktNr=Bestelldetail._ProduktNr,KHKExport.BestellID=Bestelldetail._BestellID,KHKExport.PositionID=Bestelldetail.ID
2007-03-12 17:55:47,612 Reply#120    -16 Finished executing action CREATE KHKExport FOR EACH Bestelldetail WITH KHKExport.Datum=Bestelldetail._Bestelldatum,KHKExport.KdNr=Bestelldetail._KundenNr,KHKExport.LKW=Bestelldetail._LKW,KHKExport.Menge=Bestelldetail.Menge,KHKExport.ProduktNr=Bestelldetail._ProduktNr,KHKExport.BestellID=Bestelldetail._BestellID,KHKExport.PositionID=Bestelldetail.ID
2007-03-12 17:55:47,613 Reply#120 -16 Finished resuming process 120
2007-03-12 17:55:47,620 Reply#120 -17  
2007-03-12 17:55:47,621 Reply#120 -17  
 Out of memory error encountered in the source QS
TRACE: org.openadaptor.adaptor.jms.JMSSource rolling back JMS transaction
TRACE: session is not transacted, cannot do rollback()
This happens on AwareIM Build 947 as well as 937.

Any help would be greatly appreciated,
Hubertus
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Can you try increasing memory for JBoss rather than the Aware IM server (or in addition to it)? It is possible that it is JBoss that is running out of memory, not the Aware IM server.
Aware IM Support Team
Hubertus
Posts: 153
Joined: Sat Feb 11, 2006 2:11 pm
Location: Austria
Contact:

Post by Hubertus »

Hello and good morning !

I've added -Xmx256M to Tomcat_Startup and JBoss_Startup in StartupOptions.props in the samples directory and copied it to the bin directory.
And restarted AwareIM
But I still receive an out of memory error.

What I discovered earlier was that it seems that the more records are in the database the earlier the out of mem occurs.

Hubertus
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Could you please send the BSV to [email protected] and indicate the process you are running.
Aware IM Support Team
Hubertus
Posts: 153
Joined: Sat Feb 11, 2006 2:11 pm
Location: Austria
Contact:

Post by Hubertus »

This issue is SOLVED !!!! (Although I believe that this problem results from a bug in AwareIM :wink: )

I changed the process to

Code: Select all

FIND Bestelldetail WHERE Bestelldetail.Bestellung.Tour=ThisTour
CREATE KHKExport  FOR EACH Bestelldetail WITH KHKExport.Menge=Bestelldetail.Menge,KHKExport.PositionID=Bestelldetail.ID
Which means that I've removed all occurances of shortcuts. (Attributes starting with a underscore are shortcuts) These 2 fields that get added here are sufficient for the following rule attached to "on new/on change" of BO KHKExport to find the required data.

Code: Select all

FIND Bestelldetail WHERE Bestelldetail.ID=ThisKHKExport.PositionID
KHKExport.Datum=Bestelldetail._Bestelldatum
KHKExport.KdNr=Bestelldetail._KundenNr
KHKExport.LKW=Bestelldetail._LKW
KHKExport.ProduktNr=Bestelldetail._ProduktNr
KHKExport.BestellID=Bestelldetail._BestellID
Works like a charm.
Post Reply