reqwest icon indicating copy to clipboard operation
reqwest copied to clipboard

Memory leak (possibly macOS network stack)

Open telcy opened this issue 3 years ago • 5 comments

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));
    }
}

telcy avatar Apr 11 '21 14:04 telcy

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.

bowlofeggs avatar May 18 '21 16:05 bowlofeggs

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

telcy avatar May 18 '21 17:05 telcy

I also have this problem,macOS 11.5.2.

zhang-wenchao avatar Sep 01 '21 09:09 zhang-wenchao

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

telcy avatar Oct 27 '21 13:10 telcy

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

timokoesters avatar Jan 21 '22 09:01 timokoesters