-
Notifications
You must be signed in to change notification settings - Fork 705
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
Core, WebHost: lazy-load worlds in unpickler, WebHost and WebHostLib #2156
Core, WebHost: lazy-load worlds in unpickler, WebHost and WebHostLib #2156
Conversation
this should hopefully fix customserver's memory consumption
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it should work as advertised.
customserver still uses 128MB on my machine, so the fix is incomplete :( |
Current version saves ~6MB per idle process (generation queue, hosting queue) The cython stuff eats ~20MB per MP. and the rest is also ~20MB more than expected (psutil reports 51MB before importing _speedups). After investigating the cython memory overhead, I think splitting Utils and lazy-loading settings would be the next steps. |
This saves ~15MB per MP and speeds up module import if it was built in-place.
The majority of the _speedups memory allocation was due to Biggest fish is now probably |
…rchipelagoMW#2156) * Core: lazy-load worlds in unpickler this should hopefully fix customserver's memory consumption * WebHost: move imports around to save memory in MP * MultiServer: prefer loading _speedups without pyximport This saves ~15MB per MP and speeds up module import if it was built in-place. * Tests: fix tests for changed WebHost imports * CustomServer: run GC after setup * CustomServer: cleanup exception handling
…rchipelagoMW#2156) * Core: lazy-load worlds in unpickler this should hopefully fix customserver's memory consumption * WebHost: move imports around to save memory in MP * MultiServer: prefer loading _speedups without pyximport This saves ~15MB per MP and speeds up module import if it was built in-place. * Tests: fix tests for changed WebHost imports * CustomServer: run GC after setup * CustomServer: cleanup exception handling
What is this fixing or adding?
this should hopefully fix customserver's memory consumption
How was this tested?
haven't tested it yet