scanner icon indicating copy to clipboard operation
scanner copied to clipboard

Resolved memory consumption issue, Your app was consuming too much memory and did crash for lengthy recording

Open sihatafnan opened this issue 1 year ago • 1 comments

With current implementation, if you can't record for couple of minutes because the datasetencoder object stores the captured frames and associated depth map and confidence maps and it keeps growing. Eventually the app crashes. The fix i did was, resetting the datsetencoder after a certain interval, let's say 30s and keep track of the last frame that it captured. In this way, you can free up the memory space consumed by your app for lengthy recordings and keep recording for a long time.

sihatafnan avatar Feb 27 '25 05:02 sihatafnan

This is not a very elegant solution to this problem. I haven't noticed any crashes due to memory myself. Which device are you using?

Was it in debug mode or release mode? In debug mode, encoding pngs and video is a lot slower, which could cause lots of frames to get queued up and could maybe be the source of the issue.

Did you find out more specifically what is consuming the memory? Resetting the dataset encoder at an arbitrary interval is quite hacky and would make maintaining the code harder. It could introduce subtle bugs where initialization or destruction causes some side effects.

Does this even work with the RGB frames? What happens to the video file?

kekeblom avatar Feb 27 '25 07:02 kekeblom