Memory leak when using context.QueryDevices (C # D455)
"Query Devices ()" is executed at regular intervals to detect camera disconnection.
At this time, there is no particular problem with D435, but a memory leak occurs with D455.
The language used is C # and the SDK is ver2.42.0.0.
How should I solve it?
-
Hi Shimamoto1991 When the memory is leaking, do you experience any memory errors (like in the C# case in the link below) or is it leaking silently with no warnings?
https://github.com/IntelRealSense/librealsense/issues/8272
Also, is it possible for you to update your SDK version to a current one such as 2.44.0 to see whether it makes a positive difference, please?
-
Hello, MartyG
The memory leak is silent without warning.
Judging from how the process memory of the diagnostic tool of Visual Stdio 2019 goes up.I've also updated the firmware and SDK version to the latest version, but I'm still having problems.
Firmware: ver 5.12.12.100
SDK: ver 2.44.0.0D455

D435

-
A C++ user reported a similar memory leak pattern with Visual Studio 2019 in January 2020. In their report, D435 displayed the same flat constant pattern as your D435, but D435i and D455 had the upward slope.
https://github.com/IntelRealSense/librealsense/issues/8091#issuecomment-759975908

As shown in the report linked to above, the D455 had an extra element in its memory heap snapshot named realsense2.dll__vcrt_ptd that the D435 did not have that was increasing the byte usage considerably. Does your D455 chart in Visual Studio have this same extra element, please?

-
Thank you for the information.
Looking at the memory usage graph, it seems similar to the problem I'm facing.
I tried taking a snapshot, but unfortunately it doesn't look the same as above.
I'm not very familiar with this field, and the heap size etc. hasn't changed in the snapshots I took, so it may just not be taken correctly ...

By the way, in the similar case you taught me, it seems that it has not been solved as a result.
Should I consider any other method because my goal is to get RealSense connectivity? -
I believe that in C# the device connection status can be checked with OnDevicesChanged
https://github.com/IntelRealSense/librealsense/issues/3142#issuecomment-465494716

Please sign in to leave a comment.
Comments
6 comments