cloudify-dsl-parser icon indicating copy to clipboard operation
cloudify-dsl-parser copied to clipboard

init context may cause memory leak

Open lin344902118 opened this issue 5 years ago • 1 comments

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 avatar Sep 17 '19 11:09 lin344902118

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

lin344902118 avatar Sep 17 '19 11:09 lin344902118