runtime: fix memory leak/growth when creating many runtimes (#3564)

This commit is contained in:
Ivan Petkov
2021-03-16 19:31:46 +01:00
committed by GitHub
parent e6103d6661
commit e4f76688a0
18 changed files with 437 additions and 285 deletions
+6
View File
@@ -12,9 +12,15 @@ name = "test-cat"
name = "test-mem"
required-features = ["rt-net"]
[[bin]]
name = "test-process-signal"
required-features = ["rt-process-signal"]
[features]
# For mem check
rt-net = ["tokio/rt", "tokio/rt-multi-thread", "tokio/net"]
# For test-process-signal
rt-process-signal = ["rt", "tokio/process", "tokio/signal"]
full = [
"macros",
@@ -0,0 +1,11 @@
// https://github.com/tokio-rs/tokio/issues/3550
fn main() {
for _ in 0..1000 {
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap();
drop(rt);
}
}