I have a collection of Entity objects. For each of these objects I call
GetMulti....() to retrieve a collection of dependent Entities. Is there a way to release Memory occupied by the resulting Collection without freeing the original Entity Object.
Example:
{
ImportMachineCollection imc = new ImportMachineCollection();
imc.GetMulti(null);
foreach(ImportMachine im in imc)
{
ImportSoftwareSignatureCollection issc = im.GetMultiImportSoftwareSingature(false);
// ... do some work with issc
// now im seems to hold a reference to the returned collection, so even if issc gets out of scope, memory is not released.
// is there a way to release this reference, withouth destroying the im Entity / imc Collection?
// In my application, the resulting memory footprint would be more than 2 GB...
}
} // here imc gets out of scope, memory gets freed