useful-scripts icon indicating copy to clipboard operation
useful-scripts copied to clipboard

show-busy-java-threads support MacOS

Open oldratlee opened this issue 11 years ago • 6 comments

  • Mac下使用解析命令行参数出错。Macgetopt不兼容GNU
    • 这个不是问题。自己手动来解析 来实现即可。
  • Macshow-busy-java-threads出错。Macps不兼容GNU
    • 比如 不支持 输出 线程ID(即 -L 选项)。
      • Mac下的ps-L是: List the set of keywords available for the -O and -o options.

oldratlee avatar Jan 07 '14 16:01 oldratlee

同一个文件,head --lines "${count}"部分,Mac下应为 head -n "${count}"

undancer avatar Sep 11 '14 15:09 undancer

ps -Leo pid,lwp,user,comm,pcpu --no-headersMac不兼容啊,怎么解决?

AnonymMan avatar Oct 13 '15 09:10 AnonymMan

@AnonymMan Macps命令没有支持,也没有找到其它的命令支持。


我去翻了过Mac的系统API,想写C程序来获取系统的

  • 线程ID
  • 及其CPU使用率

没有找到。


我到现在还没有找到解法, @AnonymMan 你看看有没有办法 ? :smile:

oldratlee avatar Oct 14 '15 10:10 oldratlee

@oldratlee 我这暂时也没有想到什么好的办法。

AnonymMan avatar Oct 21 '15 08:10 AnonymMan