seanmonstar / reqwest

An easy and powerful Rust HTTP Client
https://docs.rs/reqwest
Apache License 2.0
9.73k stars 1.09k forks source link

Memory leak (possibly macOS network stack) #1238

Open telcy opened 3 years ago

telcy commented 3 years ago

Executing this code adds 0.1 MB every 10 seconds when observing Activity Monitor. I had the same issues with Swift on macOS (before I rewrote my application in Rust) and start to believe it is somewhere down the network stack. Can anyone confirm this issue?

use reqwest;
use std::{thread::sleep, time::Duration};

fn main() {
    // memory grows around 0.1 MB every 10 seconds
    loop {
        let _ = reqwest::blocking::get("https://jsonplaceholder.typicode.com/posts");
        sleep(Duration::from_millis(10));
    }
}
bowlofeggs commented 3 years ago

I have tested this with reqwest 0.11.3 with Rust 1.52.1 on Linux kernel 5.10.32 and I do not see a leak.

telcy commented 3 years ago

I can confirm that it’s not an issue on Linux. I have filled a Feedback report with Apple.

zhang-wenchao commented 3 years ago

I also have this problem,macOS 11.5.2.

telcy commented 2 years ago

Apparently still an issue on Monterey and I have not received any updates on the filled Feedback (FB9076036).

timokoesters commented 2 years ago

See https://github.com/seanmonstar/reqwest/issues/1445