Skip to content

Commit 71eff18

Browse files
committed
release dashmap memory
1 parent 0f0a055 commit 71eff18

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/endpoint.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,8 @@ impl KcpEndpoint {
600600
});
601601
data.conn_map
602602
.retain(|conn_id, _| data.state_map.contains_key(conn_id));
603+
data.state_map.shrink_to_fit();
604+
data.conn_map.shrink_to_fit();
603605
tokio::time::sleep(std::time::Duration::from_secs(10)).await;
604606
}
605607
});

0 commit comments

Comments
 (0)