-
Notifications
You must be signed in to change notification settings - Fork 194
Closed as not planned
Labels
enhancementnew feature requests (or implementation)new feature requests (or implementation)
Milestone
Description
All memory assigned to the caches are leaked.
For example, in a code where quad() is called about 100000 times or so, it leaks 5 Gb of memory, when the normal usage - after fixing - is 60 Mb.
In quadrature.py, this fixes the issue:
class QuadratureRule(object):
...
def clear(self):
"""
Delete cached node data.
"""
for dp in self.standard_cache:
self.standard_cache[dp]=[]
self.standard_cache = {}
for dp in self.transformed_cache:
self.transformed_cache[dp]=[]
self.transformed_cache = {}
self.interval_count = {}
...
class QuadratureMethods(object):
...
def quad(ctx, f, *points, **kwargs):
...
finally:
ctx.prec = orig
rule.clear() # <<<<<<
if kwargs.get("error"):
return +v, err
return +v
Metadata
Metadata
Assignees
Labels
enhancementnew feature requests (or implementation)new feature requests (or implementation)