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

Question: Re-using interactive shell for multiple notebook executions #97

Open
jimkimball opened this issue Apr 12, 2024 · 3 comments
Open

Comments

@jimkimball
Copy link

We have a scenario where we are running the same notebook thousands of times. And we are seeing memory increasing significantly as we progress. Initial investigation looks like incremental memory is primarily because we import pandas and numpy in the notebooks. We were thinking if we could import pandas and numpy in the client._shell, then re-use that shell, we might be able to manage our memory. I am looking into this now, but wondered if it is something you had already explored or even already support. Thank you.

@edublancas
Copy link
Contributor

edublancas commented Apr 13, 2024

hi, we haven't explored this.

are you running the notebook iterations one at a time? if you're and you're seeing memory usage increasing that might be a bug, a user reported something similar and fixed it (#75), but there might be other leaks yet.

a quick way to fix this is to run ploomber-engine via the subprocess module, this way you'll ensure that each call completely wipes out memory

@jimkimball
Copy link
Author

jimkimball commented Apr 13, 2024 via email

@edublancas
Copy link
Contributor

yeah, I guess that there is some memory leak somewhere.

another thing you can do to speed things up is turn off our anonymous telemetry:

export PLOOMBER_STATS_ENABLED=false

I'm unsure this will have a big effect but let me know if it helps (we're thinking of removing it completely)

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