Tracking threads memory and CPU consumption

后端 未结 3 1546
没有蜡笔的小新
没有蜡笔的小新 2020-12-16 04:11

I\'m writing a Linux application which observes other applications and tracks consumption of resources . I\'m planning work with Java, but programming language isn\'t import

3条回答
  •  失恋的感觉
    2020-12-16 04:58

    If you're willing to use Perl take a look at this: Sys-Statistics-Linux

    I used it together with some of the GD graphing packages to generate system resource usage graphs for various processes.

    One thing to watch out for - you'll really need to read up on /proc and understand jiffies - last time I looked they're not documented correctly in the man pages, you'll need to read kernel source probably:

    http://lxr.linux.no/#linux+v2.6.18/include/linux/jiffies.h

    Also, remember that in Linux the only difference between a thread and process is that threads share memory - other than that they're identical in how the kernel implements them.

提交回复
热议问题