# CPU This command gives the maximum amount of memory used by `ls`: ``` /usr/bin/time -v ls Maximum resident set size (kbytes): 1116 ``` [`getrusage()`](https://man7.org/linux/man-pages/man2/getrusage.2.html) can be used in code. # GPU Nsight shows the used memory amount. ``` nsys profile --cuda-memory-usage=true ./tester --dim 1000 --target d gemm ```