Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug summary
InTriangulation
, when callingget_trifinder
, the trifinder is stored isself._trifinder
, howeverTriFinder
itself also stores a reference to the triangulation inself._triangulation
. As a result, neither object is ever destroyed.
Code for reproduction
importmatplotlib.triastriimportnumpyasnpimportpsutiln_points=500000x=np.random.rand(n_points)*100y=np.random.rand(n_points)*100whileTrue:triangulation=tri.Triangulation(x,y)trifinder=triangulation.get_trifinder()mem=psutil.virtual_memory().available*100/psutil.virtual_memory().totalprint(f"Available memory:{mem:.2f}%")
Actual outcome
Available memory: 75.65%
Available memory: 69.80%
Available memory: 63.91%
Available memory: 58.04%
Available memory: 52.15%
Available memory: 46.27%
Available memory: 40.40%
Available memory: 34.53%
Available memory: 28.65%
Available memory: 22.87%
Available memory: 17.03%
Available memory: 11.12%
Available memory: 6.25%
Available memory: 0.95%
Available memory: 0.62%
Available memory: 0.73%
Available memory: 0.95%
Available memory: 0.90%
Killed
Expected outcome
The memory should remain the same after each iteration.
Additional information
The_triangulation
attribute in TriFinder is never actually used and can be safely removed: this fixes the issue.
Operating system
Linux (Debian 12), Windows
Matplotlib Version
3.9.0
Matplotlib Backend
qtagg
Python version
3.11.2
Jupyter version
7.1.2
Installation
pip