Notifications
Announcements
No record found.
I've 1,072,369 contact records in Dynamics CRM. I needed to retrieve them and then manipulate. Now, while retrieving I faced following exception
1,072,369
Failed to allocate a managed memory buffer of 1073741824 bytes. The amount of available memory may be low.
I increased its time span to 10 minutes but no luck.
I am seeking your kind advise/help to resolve it. Following is my code snippet.
ColumnSet col = new ColumnSet(); col.AddColumns("new_name", "accountid", "contactid"); //get Related Record QueryExpression qe = new QueryExpression { EntityName = entity, ColumnSet = col, Criteria = new FilterExpression { Conditions = { new ConditionExpression("accountid",ConditionOperator.NotNull), new ConditionExpression("statecode",ConditionOperator.Equal,0) } } }; EntityCollection ec = sp.RetrieveMultiple(qe);
*This post is locked for comments
There should be no reason to keep 1 000 000 records in memory while you manipulate them. Instead, I suggest you use paging with the QueryExpression to only return some (maybe 5 000) records at a time, then dispose of the records from memory, and retrieve the next page of data
Hi,
I agree with david, for fetching record using paging, Please refer the below URL :
www.resultondemand.nl/.../0be338b9-dbb1-41b6-b313-c632e40d2af5.htm
You can create pagination and records count and release the memory of the entity collection like this ec.Entities.Clear()
The Dispose function is not available on the EntityCollection only on other components such as FileStreams for example.
I was facing this issue and this solution helped me.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2