-
Notifications
You must be signed in to change notification settings - Fork 819
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: fix some memory leak sources without removing caching #2400
Core: fix some memory leak sources without removing caching #2400
Conversation
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.
With just Subnautica it now deallocates the multiworld as desired. Remaining culripits are probably in the world folders. Don't know if that should be adressed in this PR or a follow-up, but as is, this PR is an improvement.
I'd like to see if someone can figure out the pycharm linter error. Two things to check in the meantime are If you beat me to it, feel free to push to my branch. |
genning with just zillion also de-allocates. |
I'm not seeing "Parameter(s) unfilled" on the new code in BaseClasses. |
I think that's what's solved with typing.Self on newer python. |
I see. Honestly, this could be a PyCharm issue. The typing seems correct. |
I don't think so, because PyCharm claims the number of arguments is wrong, not the type.
There are a couple of issues open for PyCharm with decorator and typing, so it's very likely. Typing also looks correct to mypy and me. |
Find which issue it is and leave a comment... on both ends, I'd say. |
Can you make a test that creates a multiworld for each world type and checks whether it can be deallocated? |
|
Maybe like this @el-u ? |
Are we sure the current test failures now are accurate? It not leaking on 3.11 feels odd. |
No. I'd say the test failures are not understood. It fails for worlds that deallocate properly when just running generate. Could be that there's something wrong with the test. Failing worlds are basically LADX + Minecraft + those that use the new options system; but unsure whether that has anything to do with it. |
Those failure are bogus and only happen on py<3.11. I've been trying to figure out why, but I hit a dead end again. The references to the MultiWorld are all regions, but I am not sure where they are referenced - I'm afraid that might be somewhere inside unittest? An assertion or a subtest maybe? I think I'll just disable the failing ones for <3.11 for now and leave a comment. The generic (default options) test still works for those at least. |
…lagoMW#2400) * Core: fix some memory leak sources * Core: run gc before detecting memory leaks * Core: restore caching in BaseClasses.MultiWorld * SM: move spheres cache to MultiWorld._sm_spheres to avoid memory leak * Test: add tests for world memory leaks * Test: limit WorldTestBase leak-check to py>=3.11 --------- Co-authored-by: Fabian Dill <[email protected]>
…lagoMW#2400) * Core: fix some memory leak sources * Core: run gc before detecting memory leaks * Core: restore caching in BaseClasses.MultiWorld * SM: move spheres cache to MultiWorld._sm_spheres to avoid memory leak * Test: add tests for world memory leaks * Test: limit WorldTestBase leak-check to py>=3.11 --------- Co-authored-by: Fabian Dill <[email protected]>
Supersedes #2399
Use of @Utils.cache_self1 gives a "Parameter(s) unfilled" on call site in pycharm, but mypy claims it's fine. If anyone knows if we can fix that, please let me know.
Maybe @el-u with the typing experience.