Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Fix modules reload leak #182

Closed
wants to merge 16 commits into from
Closed

Fix modules reload leak #182

wants to merge 16 commits into from

Conversation

MikhailArkhipov
Copy link

Fixes #109

Simplifies event listening and make things happen in proper order. Reloading modules no longer increases RAM.

@@ -274,6 +274,7 @@ internal class AstPythonInterpreter : IPythonInterpreter2, IModuleContext, ICanF
}

_analyzer = state;
RemoveImportedModules();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a lock here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code locks on _userSearchPathImported operations

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am resolving it on another work with importing/search paths

foreach (var mod in _modulesByFilename.Values) {
mod.Clear();
mod.EnsureModuleVariables(this);
}

_interpreterFactory.NotifyImportNamesChanged();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is listening to this ImportableModulesChanged event?

Copy link
Author

@MikhailArkhipov MikhailArkhipov Oct 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AstFactory and AstIntepreter, erasing caches

@MikhailArkhipov
Copy link
Author

#209 first

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

Successfully merging this pull request may close these issues.

2 participants