sysinfo: [Important]Memory Leak

Crate Version:0.14.5-Latest Kernel Version:Linux 4.14.81.bm.15-amd64 #1 SMP Debian 4.14.81.bm.15 Sun Sep 8 05:02:31 UTC 2019 x86_64 GNU/Linux Recurrence:

use sysinfo::{System,SystemExt};
fn main() {
    loop {
        let mut system = sysinfo::System::new_all();
        system.refresh_all();
        system.refresh_cpu();
        system.get_total_memory();
        system.get_free_memory();
        system.get_used_memory();
        system.get_used_swap();
        system.get_free_swap();
        system.get_used_swap();
        system.get_processors();
        system.get_disks();
    }
}

Then,watch you RSS of this process.Woooooooooow,you will get a big surprise!!!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 34 (16 by maintainers)

Most upvoted comments

Yes it should, it’s just that the issue isn’t that critical considering that you’re only supposed to have one System. I’ll still try to fix the memory leak.