Azure-Kinect-Sensor-SDK icon indicating copy to clipboard operation
Azure-Kinect-Sensor-SDK copied to clipboard

Memory leak when starting IMU

Open oilst opened this issue 5 years ago • 6 comments

When starting the IMU with
_device.StartImu(); the memory consumption increases steadily. As soon as I stop the imu with _device.StopImu(); the memory consumption does not increase anymore.

Expected behavior Starting the Imu should not create a memory leak.

Desktop:

  • OS with Version: Windows 1903
  • SDK Version: 1.4.0
  • Firmware version:
    RGB camera firmware: 1.6.98 Depth camera firmware: 1.6.70 Depth config file: 6109.7 Audio firmware: 1.6.14

oilst avatar May 28 '20 11:05 oilst

Could you please provide more precise repro steps? Is this C/C++ or C#? Are you running one of the samples? What tool are you using to monitor memory leakage? Did you wait long enough for queue stabilization (wait beyond 15 seconds)?

qm13 avatar Jun 01 '20 17:06 qm13

Steps to reproduce:

  • checkout https://github.com/microsoft/Azure-Kinect-Samples/tree/master/body-tracking-samples/csharp_3d_viewer
  • add device.StartImu(); after line 26 in Program.cs
  • run the program in VS 2019 and monitor the memory in VS. The memory increases over time (I tried for 10 minutes and it is still increasing)

oilst avatar Jun 02 '20 06:06 oilst

Same issue on my side

DirkKramer avatar Sep 11 '20 09:09 DirkKramer

The issue is also occurring in C# and Unity3D. You can reproduce it easily:

Unity3D

  • Start any Kinect Unity application.
  • Open the Profiler.
  • Select Memory.
  • Take a sample.

On some computers, ManagedHeap.UsedSize reaches 1 GB within a few seconds and keeps growing. Also, you'll notice that the Task Manager's memory consumption is increasing.

Vangos avatar Oct 06 '20 11:10 Vangos

I discovered this issue too, with nuget package Microsoft.Azure.Kinect.Sensor 1.4.1. Are there going to be an update in the future @qm13 ?

kimjetam avatar May 14 '21 21:05 kimjetam

This is still an open issue. I've just spent couple of hours trying to find a memory leak in my code and it turned out to be this bug related to the IMU. :(

gregorijk avatar Sep 28 '21 00:09 gregorijk