请高手 帮忙 解决一个问题监控 window 或者 linux 下进程的内存使用我用 Process p = Runtime.getRuntime().exec("tasklist") //或者 ps -ef|grep jar  ps -v|grep jarInputStream in = p.getInputStream();
剩下 对inputStream的处理 还是用其他办法解决??希望大家帮忙一下。。

解决方案 »

  1.   

    一般都用ps -ef|grep jar ps -v|grep jar, 但是多用c来做, 目前还不知道能用java做
      

  2.   

    用这个:hyperic-sigar
    方便快捷http://support.hyperic.com/display/SIGAR/Home#Home-overview
      

  3.   

    The Sigar API provides a portable interface for gathering system information such as:System memory, swap, cpu, load average, uptime, logins
    Per-process memory, cpu, credential info, state, arguments, environment, open files
    File system detection and metrics
    Network interface detection, configuration info and metrics
    TCP and UDP connection tables
    Network route table
      

  4.   

    没错
    如果对具体进程操作,从tasklist中取出该进程。