andrewRowlinson / mplsoccer

Football pitch plotting library for matplotlib
MIT License
391 stars 80 forks source link

Memory leak #69

Closed andrewRowlinson closed 1 year ago

andrewRowlinson commented 1 year ago

There is a problem when mplsoccer is combined with Streamlit. The amount of memory keeps increasing when creating new charts. It seems to be caused by the custom handlers.

https://github.com/andrewRowlinson/mplsoccer/blob/d9956e81e85af31a4d32bad4986338580f83b43d/mplsoccer/linecollection.py#L178

https://github.com/andrewRowlinson/mplsoccer/blob/d9956e81e85af31a4d32bad4986338580f83b43d/mplsoccer/quiver.py#L113

Is there a better way of doing this?

andrewRowlinson commented 1 year ago

Fixed by #55

https://github.com/andrewRowlinson/mplsoccer/blob/8bdf59e267fb51efbeaa95e0e47c52b6bfbfcd7a/mplsoccer/linecollection.py#L178

https://github.com/andrewRowlinson/mplsoccer/blob/8bdf59e267fb51efbeaa95e0e47c52b6bfbfcd7a/mplsoccer/quiver.py#L113