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 []( 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 答疑

评论 抢沙发

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

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