Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory consumption #235

Open
RobRomijnders opened this issue Dec 21, 2022 · 3 comments
Open

Memory consumption #235

RobRomijnders opened this issue Dec 21, 2022 · 3 comments

Comments

@RobRomijnders
Copy link

Hi all, thanks for implementing this API. It has enabled great research already.

I am running into memory problems. Running the simulator with 1 million users, it's intended use-case, my 60 gb memory run out in under 40 steps. Changing the 'days_of_interactions' parameter hasn't changed that.

Am I doing something wrong? What typical memory consumption do you observe?

Thanks in advance,
Rob

@p-robot
Copy link
Contributor

p-robot commented Jan 11, 2023

Hi Rob,
Great to hear that OpenABM has been a useful tool!

Regarding your question, a simple run of the model with 1 million individuals should definitely not exhaust 60Gb of memory. The example in examples/example_101.py with 1M users runs without any hiccups on my 2016 MBP, which has 8Gb of physical memory:

import COVID19.model as abm
model = abm.Model( params = { "n_total" : 1000000, "end_time": 50 } )
model.run()

Would it be possible for you to please provide a minimal example of where you're coming up against problems with memory? It will help us diagnose the issue.

Best regards,
Will

@RobRomijnders
Copy link
Author

Hi Will,

Thanks for the help. I digged a bit further and realized the memory leak was in the Python-bindings with SWIG. I'll make a pull-request soon to fix this.

Indeed, after the fix 100k users consumes less than 5gb and 1M users consumes less than 10gb.

@p-robot
Copy link
Contributor

p-robot commented Jan 11, 2023

Hi Rob,
That's good to hear that you've found a remedy in the interim. That'd be fantastic if you had a PR for the issue you found - many thanks for contributing.
Will

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants