I loaded a large dataset into memory in python as follows:
data = dict(np.load(open('/path/to/data', 'rb')))
free
and top
(and also htop
) both show that a lot of memory is in use:
$ free -h
total used free shared buff/cache available
Mem: 62G 42G 354M 41M 20G 20G
Swap: 63G 447M 63G
$ top
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6830 gmr 20 0 42.265g 0.041t 7296 S 0.0 66.1 34:52.22 ipython
But csysdig
shows much less memory usage:
$ sudo csysdig
PID CPU USER TH VIRT RES FILE NET Command
6830 0.00 gmr 13 2G 2G 0 0.00 /usr/bin/python /usr/bin/ipython
What is the reason for this discrepancy?