-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest version of libnice give a memory leak #13
Comments
The leak is not consistent, it can also happen with but I reproduce it maybe more often with There is definitely no Arc anymore in switchboard when that happens.
in switchboard.rs impl Switchboard {
pub fn print_state(&self) {
let mut output = String::new();
// Print sessions
output.push_str("Sessions:\n");
for session in &self.sessions {
output.push_str(&format!(" Session {:p}\n", Arc::as_ptr(session)));
}
// Print publishers_by_room
output.push_str("Publishers by Room:\n");
for (room_id, sessions) in &self.publishers_by_room {
output.push_str(&format!(" Room {}:\n", room_id));
for session in sessions {
output.push_str(&format!(" Publisher {:p}\n", Arc::as_ptr(session)));
}
}
// Print publishers_by_user
output.push_str("Publishers by User:\n");
for (user_id, session) in &self.publishers_by_user {
output.push_str(&format!(" User {}: Publisher {:p}\n", user_id, Arc::as_ptr(session)));
}
// Print subscribers_by_user
output.push_str("Subscribers by User:\n");
for (user_id, sessions) in &self.subscribers_by_user {
output.push_str(&format!(" User {}:\n", user_id));
for session in sessions {
output.push_str(&format!(" Subscriber {:p}\n", Arc::as_ptr(session)));
}
}
// Print publisher_to_subscribers
output.push_str("Publisher to Subscribers Mapping:\n");
output.push_str(" Forward Mapping:\n");
for (publisher, subscribers) in &self.publisher_to_subscribers.forward_mapping {
output.push_str(&format!(" Publisher {:p}:\n", Arc::as_ptr(publisher)));
for subscriber in subscribers {
output.push_str(&format!(" Subscriber {:p}\n", Arc::as_ptr(subscriber)));
}
}
output.push_str(" Inverse Mapping:\n");
for (subscriber, publishers) in &self.publisher_to_subscribers.inverse_mapping {
output.push_str(&format!(" Subscriber {:p}:\n", Arc::as_ptr(subscriber)));
for publisher in publishers {
output.push_str(&format!(" Publisher {:p}\n", Arc::as_ptr(publisher)));
}
}
// Print blockers_to_miscreants
output.push_str("Blockers to Miscreants Mapping:\n");
output.push_str(" Forward Mapping:\n");
for (blocker, miscreants) in &self.blockers_to_miscreants.forward_mapping {
output.push_str(&format!(" Blocker {}:\n", blocker));
for miscreant in miscreants {
output.push_str(&format!(" Miscreant {}\n", miscreant));
}
}
output.push_str(" Inverse Mapping:\n");
for (miscreant, blockers) in &self.blockers_to_miscreants.inverse_mapping {
output.push_str(&format!(" Miscreant {}:\n", miscreant));
for blocker in blockers {
output.push_str(&format!(" Blocker {}\n", blocker));
}
}
// Output the state using janus_info!
janus_info!("{}", output);
} and in lib.rs in destroy_session sess.destroyed.store(true, Ordering::Relaxed);
switchboard.print_state(); |
See leak stacktrace in #11 (comment) and versions tested in #11 (comment)
The text was updated successfully, but these errors were encountered: