Using htop or free inside a container gives the information for host machine resources. However I want the utilization status specific to the container. lxc info on a container id gives me the following result:-
Resources: Processes: 153 Memory usage: Memory (current): 1.44GB Memory (peak): 1.52GB Network usage: eth0: Bytes received: 1.39MB Bytes sent: 7.71MB Packets received: 6967 Packets sent: 7041 lo: Bytes received: 1.73MB Bytes sent: 1.73MB Packets received: 3989 Packets sent: 3989 lxdbr0: Bytes received: 0B Bytes sent: 470B Packets received: 0 Packets sent: 5
But this information is not consistent with htop on the host machine. htop tells me that each container is using 98M of memory. Even if I account for slight difference in measurement 98 MB and 1.44GB are two very different results. What is the best way to find the memory usage of a container?