How can I measure the actual memory usage of an application or process?

后端 未结 30 3118
心在旅途
心在旅途 2020-11-22 03:01

This question is covered here in great detail.

How do you measure the memory usage of an application or process in Linux?

From the blog articl

30条回答
  •  独厮守ぢ
    2020-11-22 03:57

    In recent versions of Linux, use the smaps subsystem. For example, for a process with a PID of 1234:

    cat /proc/1234/smaps
    

    It will tell you exactly how much memory it is using at that time. More importantly, it will divide the memory into private and shared, so you can tell how much memory your instance of the program is using, without including memory shared between multiple instances of the program.

提交回复
热议问题