Open ClementTsang opened 3 years ago
Tested a bit more, seems like I initially messed up the comparison and the issue just seems to be on WSL1.
Awesome investigation, thanks for doing it!
Based on this one function from psutil, we can't expect to have MemAvailable:
line for kernels < 3.14 and should calculate it manually.
I've been having issues with using the memory library within a WSL1 instance on Ubuntu 18.04.
I tried to run the "free" example on a WSL1 instance using Ubuntu 18.04, and it fails with this error:
It works fine on the WSL2, though.
Taking a look at the
/proc/meminfo
files of both of these, I think the issue is that the "MemAvailable" field doesn't exist on WSL1:On the WSL2, it looks like:
Guessing that since one field is missing, it's tripping up the number of lines check in
memory.rs
?