Memory leak while doing pipeline start - stop
| Required Info | |
|---|---|
| Camera Model | { D400 } |
| Firmware Version | - |
| Operating System & Version | Win (10) |
| Kernel Version (Linux Only) | - |
| Platform | PC |
| SDK Version | 2.50.0 } |
| Language | {C } |
| Segment | {others } |
Issue Description
Hi, I noticed significant increase of memory usage over time while performing start/stop IMU stream via RaelSense Viewer. Same is with start/stop of depth or rgb streams. I tried to debug the code and came to the conclusion that if I comment out "glCopyTexImage2D" function call (file rendering.h, inside function draw_motion_data) memory increase stops. Is this issue known?
Hi @niho518 A fix for memory leaks during stop-start of the IMU when using QueryDevices() was also implemented in version 2.48.0 so it may be worth testing 2.48.0 to see whether your issue might be a regression in 2.50.0 from the previous fix.
https://github.com/IntelRealSense/librealsense/releases/tag/v2.48.0
You can obtain a standalone version of the 2.48.0 Viewer from the 'Assets' file list at the above link by downloading and running the file Intel.RealSense.Viewer.exe
Hi @MartyG-RealSense, with 2.48.0 and D415 camera I can reproduce a memory leak while starting and stopping RGB stream (will test IMU on D435i later during the day).
Thanks very much for the information. I look forward to your forthcoming D435i test results.
Tested with D435i (wtih RealSense SDK version 2.48.0), memory leak can be reproduced. Simple continuous start/stop of IMU stream in RealSense viewer.
Thanks for the results. Which tool are you using to track the memory leak, please? For example, it was found that detecting leaks with Valgrind may result in false positive results of leaks, as discussed at https://github.com/IntelRealSense/librealsense/issues/9141#issuecomment-853658523
I'm using visual studio 'Diagnostic Tools' and windows task manager (simply observe memory usage increase over time).
As you found that the leaks stopped if you commented out glCopyTexImage2D, does the leak still occur if you update the graphics drivers on your Windows computer and therefore update the OpenGL driver too in doing so?
Hi @niho518 Do you require further assistance with this case, please? Thanks!
Hi @MartyG-RealSense, my gpu drivers are up to date so the initial problem still exist.
Which firmware version are you using, please? Firmware 5.13.0.50 included a fix for intermittent failures during repeated depth stop-start.
https://github.com/IntelRealSense/librealsense/wiki/Release-Notes#whats-new

Hi @niho518 Do you require further assistance with this case, please? Thanks!
Case closed due to no further comments received.