High RAM usage

For those who may be struggling with similar issues, I solved my problem. The problem was with using SharedArrays. In my example code, I have a function model_compute, which is iterated on and creates SharedArrays each time it is run. Unlike Arrays, these do not seem to be eliminated once the function has run, which means they continue to occupy space in memory. Therefore, I create the SharedArrays once, pass them to the function model_compute!, which updates them in place, as per @Sukera’s suggestion:

This takes care of the RAM problem.

3 Likes