The server running out of memory was due to the concurrent writes to the MongoDB and the saves would accumulate a lot of memory until the server runs out of heap memory to allocate.
We need to either change the way we send (currently in batches with the size according to the population size) or improve the time it takes to send all the data to the server.
Acceptance criteria:
[ ] Improve the time it takes to send the data
[x] The server does not run out of memory or crash due to writing to the database.
Description:
The server running out of memory was due to the concurrent writes to the MongoDB and the saves would accumulate a lot of memory until the server runs out of heap memory to allocate.
We need to either change the way we send (currently in batches with the size according to the population size) or improve the time it takes to send all the data to the server.
Acceptance criteria: