Skip to content
This repository has been archived by the owner on Oct 5, 2020. It is now read-only.

init context may cause memory leak #142

Open
lin344902118 opened this issue Sep 17, 2019 · 1 comment
Open

init context may cause memory leak #142

lin344902118 opened this issue Sep 17, 2019 · 1 comment

Comments

@lin344902118
Copy link

dsl_parser/framework/parser.py between line 123 to 133.
def _traverse_element_cls(self,
element_cls,
name,
value,
parent_element):
element = element_cls(name=name,
initial_value=value,
context=self)
self._add_element(element, parent=parent_element)
self._traverse_schema(schema=element_cls.schema,
parent_element=element)
When initial element,context reference to itself, this may cause memory leak.Because circular reference exist,memory can not be collect by python garbage。

@lin344902118
Copy link
Author

I think should import gc and exec gc.collect to free the memory.

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

No branches or pull requests

1 participant