Mendix instance restarts after large data comparison / no error in logs
Hi all, we run a large data comparison activity with mendix. Basically we build a outer while loop to loop over a database to retrieve always 15000 entries. The inner loop iterates over those entries 1-by-1 and then commits updates to the database. The database holds around 800.000 entries, so the retrieve and commit of 15.000 rows is executed around 50 times. This works successfully, however at the end of the outer loop, the mendix instance automatically restarts. There is no error in the log, as the objects are retrieved and committed in the inner loop.
Probably your instance restarts with a heap space error.
It is not possible, or at least it requires a lot of space to hold 800.000 entries in memory. So split this into batches.
BTW consider using OQL to compare data, because databases are built for that.
Chris de Gelder
This might lead into a huge problem and the runtime might be affected, try to retrieve using batches, and sort the retrieve based on a unique value and do a manual loop to complete it, it is recommended to retrieve 1000 object per retrieve as a max, do you know the how much core resources you’re using for your hosted application ?