Skip to Content
avatar image
Former Member

MEMORY LEAK in SAP B1 DI API

I am using following code ,

company.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode;
var productionTrees = company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductTrees) as SAPbobsCOM.ProductTrees;
productionTrees.GetByKey(itemcode);

var bomxml = productionTrees.GetAsXML();
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(productionTrees);
productionTrees = null;
GC.Collect();


This doesn't release any Memory. Please suggest.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 24, 2016 at 07:35 AM

    Hi Muhammad,

    Did you use a memory profiler to check if the memory has been reclaimed? Using the memory displayed in the Task Manager is not a very accurate indicator of memory usage.

    Pedro Magueija

    LinkedIn | Twitter | Blog

    Add comment
    10|10000 characters needed characters exceeded