r9y9 / pylibfreenect2

A python interface for libfreenect2
http://r9y9.github.io/pylibfreenect2/latest/
Other
136 stars 53 forks source link

memory leakage when running the examples #43

Open mfkenson opened 7 years ago

mfkenson commented 7 years ago

Both examples multiframe_listener.py and selective_streams.py make my mac running out of memory after keep running 1-2 minutes. I have 16GB memory. It took only few seconds to increase 500MB memory usage. The libfreenect2's example "Protonect" has no problem. The memory usage is only about 110MB.

r9y9 commented 7 years ago

https://github.com/r9y9/pylibfreenect2/blob/7fc73dedd7b18109630cbfb10a53f514c443f839/examples/multiframe_listener.py#L88 This line is required to release memory for depth/color frames allocated by libfreenect2.

Did you run both examples with no modifications? If so, could you please debug which line causes memory leak? I don't have Kinect v2 right now so I cannot debug examples, sorry. It might be worth trying different packet pipelines (OpenGLPacketPipeline, CpuPacketPipeline, etc).