Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SB1 2007A DI Memory leak?

Hi,

I've got a DI application containing the code fragment below. It contains a loop that loads an item, then loops through the price lists and updates a specific pricelist.

It seems that every time the loop runs about 1MB of is added to the SAP Business One process. If the loop runs long enough, SAP B1 runs out of memory.

Is there anyway to perform a large number of DI operations in a loop without the memory leak?

Cheers,

Ben

Items ITM = (Items)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems);

Items_Prices Prices = null;

for (int i = 0; i < gvPriceList.DataRowCount; i++)

{

try

{

B1Data.dtItemPricesRow row = (B1Data.dtItemPricesRow)gvPriceList.GetDataRow(i);

ITM.GetByKey(row.ItemCode);

Prices = ITM.PriceList;

for (int j = 0; j < Prices.Count ; j++)

{

Prices.SetCurrentLine(j);

if (Prices.PriceList == int.Parse(PriceList_Purch))

{

try

{

Prices.Currency = row.Currency;

}

catch

{

}

Prices.Price = (double)row.NettPurchasePriceForeign;

ITM.Update();

break;

}

}

}

Former Member
Former Member replied

Hi Ben,

This is a pretty big memory leak using this object.

What patch of Business One are you using? There was an issue fixed in 2007A PL37 (Note 1151766).

I would recommend logging a message for SAP support to report this leak.

Cheers,

Lisa

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question