Open yacn opened 5 years ago
Can confirm. In the project i'm currently working on we use watchdog as well. We also used the tracemalloc
package to look for the top memory consumers, and using the InotifyObserver
of watchdog, it was leading the charts with increasing memory usage over time. The scripts were running on a Ubuntu 19.10 machine, Python 3.7.4. The only workaround for us was to explictly use the PollingObserver
instead of the Observer
class.
Definitely, something may need to be improved. Do you have a clue or even a patch almost ready for that? :crossed_fingers: :)
Hey I have the problem on my embedded system. Each Observer I created on a folder with a lot of activity will increase his memory and provoke my system to kill process.
It's a big issue, does anyone has a solution ?
Polling is not an option for us
Does this problem still persists? Or has it been fixed in one of the future releases.
This issue seems to exist in v3.0.0
Confirming, this issue still exists in 3.0.0
looks like this issue still exits in the latest version (v6.0)
Having similar issues, my service has a really fast rate of file changes and the memory usage builds up really quickly. I have noticed the same areas of concern.
Also I wanted to add that the event_queue
is never really cleaned up leading to further build up.
Platform we're running on : Ubuntu 18.04, Python 3.6.8
Context: We have a long running service that uses
watchdog
to watch a log file and parse it when it's moved.Anyways, we've been tracing a memory leak in it with
tracemalloc
and it appears likewatchdog
is the culprit, it's the top memory consumer compared to the snapshot taken when starting the app:some more showing it's one of the top mem incrementors:
When looking at the tracebacks for this, these are the top memory consuming lines:
So it seems to me that the issue is the
InotifyEvent
objects that get created are never closed / garbage collected until theObserver
object stops / joins.I've tried issuing a
del event
after we are finished using it but this has no perceptible effect, something else is holding on to a reference to the event.How could we "forcibly" close or delete the
InotifyEvent
orFileSystemEvent
when we're done with it?