Measuring memory usage of a process on Linux

I am trying to measure the memory usage of a process (a java program) on linux and have two questions related to that: 1. I tried using the script [ps_mem.py](http://www.pixelbeat.org/scripts/ps_mem.py)(sums values from /proc/$PID/smaps) and the peak of total memory usage was about 135MB (private and shared memory). The amount of shared memory is less than 1MB. Trying to use Valgrind with the massif tool valgrind --tool=massif --trace-children=yes --stacks=yes java myProgram yields about 10MB at the peak of memory usage. Now as I understand it, heap is where the variables of my program are stored, does it mean that the difference between the two methods is the space taken by the code itself (including the jvm)? 2. Does the same program use different amount of memory on different machines if they have different amount of RAM or/and use different processors (ARM or x86)?

以上就是Measuring memory usage of a process on Linux的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏