Nano freezes when running deepstream continuously

I am running the deepstream-reference-app with a customized dsexample plugin. I am using 2 rtsp sources and and rendering the output on screen using EGL sinks. I am using deepstream 4.0.2 for jetson and jetpack is 4.3.

The issue is when I let the app run continuously for some days -(7-10 days), nano freezes and the only way out is to restart nano. How to resolve this?

Which deepstream-reference-app are you running?
Is there any simple way to repro your issue or could you do some debug firstly to narrow down the root cause, I think you can monitor some system parameters to check if there is any exception when the nano freezes.