how to reset memory? #2158
-
Hello, currently on the device side, I’m using createSampleConfiguration, initKvsWebRtc, and initSignaling functions to connect to WebRTC as the master. At this point, the memory usage is only 10MB (I refer to this state as State 0). However, once one or more viewers start watching, the memory increases based on the number of viewers. Even though the logs show that each viewer disconnection triggers closePeerConnection and freePeerConnection, the memory only decreases by a very, very small amount. How can I restore the memory to the State 0 value? I cannot call freeSignalingClient and freeSampleConfiguration because I’m using a persistent connection—the device connects to WebRTC via createSampleConfiguration, initKvsWebRtc, and initSignaling immediately upon boot. What I want is for the sessionCleanupWait function to restore the memory to State 0 after streamingSessionCount remains at 0 for a certain period. Where should I make this change? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, this is likely due to RSS memory not being released by the operating system as a system optimization, although it is freed in the running process. There may be some calls such as |
Beta Was this translation helpful? Give feedback.
Hi, this is likely due to RSS memory not being released by the operating system as a system optimization, although it is freed in the running process. There may be some calls such as
malloc_trim(0)
which you can try to manually release freed memory.