-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
depth frame size is different when we start and stop the pipe after receiving one frame #10432
Comments
Hi @sarath-kumar1 I would definitely not recommend performing a start-stop every frame except when creating a camera stress-test application to see how stability holds up after repeated start and stops. It sounds as though your application is experiencing a memory leak where the computer's free memory capacity is progressively consumed over time whilst the program is running instead of the memory being released. Would it be possible to post your original script (the one without start-stop) in a comment below, please? |
Dear @MartyG-RealSense , please find below my sample Qt code to capture depth frames //Derived class method which triggers for every 33 ms to read frame data
} // this is base class for checking device connectivity and starting a pipe
} |
Does any part of your project make use of a Qt function called QImage A RealSense user who was using Qt and had an apparent memory leak stated in #7968 (comment) that their debugging found that QImage was causing it in their particular project. |
i am not using QImage in this scenario, i am just copying frame data to a buffer and streaming it on TCP/IP. |
Looking at your code in thevoid DeviceRealSense::dataReceived() function, the rs2:: instructions appear to be called every 33 ms to update them. The two instructions below are ones that should be placed before the pipe.start instruction and therefore run only once when the program launches, not looped.
The SDK's rs-multicam C++ script that uses ctx / query_devices code provides a demonstration of this principle of placing these instructions before the pipe start. https://github.com/IntelRealSense/librealsense/blob/master/examples/multicam/rs-multicam.cpp#L15-L31 I wonder whether you are aiming to query the camera(s) every 33 ms to check whether they are still connected. If so then this would not be a recommended approach. Instead, the 'correct' way would be to listen for camera connect and disconnect events with a C++ instruction such as set_devices_changed_callback, as described at #931 |
Dear @MartyG-RealSense ,
|
Does it still occur if you remove '500' from the wait_for_frames() brackets? In #6569 (comment) a RealSense team member suggests an alternative approach to using |
Dear @MartyG-RealSense , |
Have you tried running a simple C++ example like the RealSense SDK's Ready to Hack test script at the link below to check whether the memory leak still occurs when running another script? If it does then it could indicate that the memory leak problem is not related to your code but to something happening elsewhere, such as in Qt https://github.com/IntelRealSense/librealsense#ready-to-hack |
hi @MartyG-RealSense , we tried with simple standalone app for just reading frames , and found no memory leaks while reading frames. |
Thanks very much for the update, @sarath-kumar1 :) As you suggested, I will close the case. Thanks again! |
Hi,
i am using Real sense D435i camera to capture depth frames.
when i am running my application with stream enabled (width = 1280, height = 720) , i am getting always depth image of size 2764800 bytes which is valid but it is causing the increase of process size in RAM upto 2GB (95%).
To avoid this i started doing pipe.stop() , pipe.start() after receiving each frame, Now process size is not improving much in RAM, but it is causing decrease in depth frame size.
Please find below log for more info:
void __cdecl DeviceRealSense::dataReceived(void) Recieved Real Sense Data
depth.get_data_size() 2764800
void __cdecl DeviceRealSense::dataReceived(void) Recieved Real Sense Data
depth.get_data_size() 1221120
Need help on, how to avoid the application to use memory upto 95% and collect depth frames with no loss.
The text was updated successfully, but these errors were encountered: