Out of memory when passing large (aggregate) list to server

I have an aggregate with approximately 10.000 records (1 record holds 17 fields with simple text). When I try to pass this to a server action in the browser appears a message:
When I reduce the amount of records to 5.000 it works just fine.

How can I make sure that all records are passed to the server without this error?


Hi Rogier,

Is there a way you can combine the aggregate and the server action in another server action and call that? Your browser is probably already straining to hold the 10,000 records locally, and when you make the server action call, it needs to serialize the list to JSON to send it via REST, which causes the out of memory error.

The downside is that if you filter the data on the screen, and its the filtered data you need to send to the server action, you need to synchronize the filtering. Also, it may take slightly more time, as the data needs to be retrieved for the screen and for the server action. On the other hand, you can then limit the data retrieved for the screen, as you won't need all 10,000 records at once.

Hi Kilian,

Yes this is possible and is an excelent idea. I was already moving the aggregate into the server action. I will only pass the filters from the client and not the whole list.

Thank you


Hi Rogier,

Happy to help :). Have a nice day!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.