I have a microflow used for conversion or migration with batching (retrieve and thus committing in batches). I will to try to upload it to the Marketplace for you to use.
I believe that you can retrieve the data in batches by setting an offset and then use the EndTransaction action which will free the memory
Do the same until an empty list is retrieved.
More about it here: https://forum.mendix.com/link/space/app-development/questions/16292
Hope this helps!