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

Portfolio.stats consumes large amount of memory. #704

Open
shaft3796 opened this issue Apr 25, 2024 · 1 comment
Open

Portfolio.stats consumes large amount of memory. #704

shaft3796 opened this issue Apr 25, 2024 · 1 comment

Comments

@shaft3796
Copy link

shaft3796 commented Apr 25, 2024

With my current data and code setup, a portfolio.stats call to one of my portfolio takes more than 1GB, however the return value of the stats call takes only 0.02GB.

I guess it's because there is some caching by the stats method under the hood. If it's the issue, is there a way to disable such caching, I don't see why I would need it. I have to run the stats call on multiple portfolios so even with large amount of memory, I'm quickly limited.

Thanks you btw, great tool 👍

@shaft3796 shaft3796 changed the title Portfolio.stats consume large amount of memory. Portfolio.stats consumes large amount of memory. Apr 25, 2024
@shaft3796
Copy link
Author

shaft3796 commented Apr 25, 2024

I found workaround consisting of running the .stats call in a separate process, getting the result using a queue and killing the process. I can now get the result of .stats call without the +1GB memory still allocated.
But let's be honest, this is not the cleanest code I have wrote 😅

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

1 participant