Join GitHub today
domain: fix memory leak for stats #7864
What problem does this PR solve?
When the stats-lease is 0 or stats updating worker panics, the memory usage of stats will increase as long as there are new sessions.
What is changed and how it works?
When there is a new session, we will create a session stats collector, and it will be freed by the background stats worker when the session exits. Now only when the stats worker exists, which means the stats lease is not zero and the stats worker is running, we will create a new session stats collector.
eurekaka left a comment •
BTW, seems the existing
Maybe the session should check if it has