Skip to content

Commit

Permalink
更新文章内容
Browse files Browse the repository at this point in the history
  • Loading branch information
guobinhit committed Apr 14, 2020
1 parent 12264ff commit a9431d1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions articles/others/jvm-cpu-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,20 @@
特别地,在 mock 底层接口的时候,使用了类似`TimeUnit.SECONDS.sleep(1)`这样的语句。

至于为何在 **下午3:45** 分之后,CPU 的使用率降下来了,则是因为停止了压测。


--------

除此之外,我们还可以使用`jinfo``jstat`命令来查询 Java 进程的启动参数以及 GC 情况:

- 使用`jinfo PID`命令,查询启动参数:

![jinfo](https://github.com/guobinhit/cg-blog/blob/master/images/others/jvm-cpu-issue/jinfo.png)

如上图所示,使用该命令我们主要是为了查询启动参数,如初始化堆大小、垃圾回收器等配置。

- 使用`jstat -gcutil PID 1000`命令,查询 GC 情况:

![jstat](https://github.com/guobinhit/cg-blog/blob/master/images/others/jvm-cpu-issue/jstat.png)

如上图所示,显示了`PID``20567`的 Java 进程每秒的 GC 情况,其中`1000`表示 GC 状态的更新频率,单位为毫秒。
Binary file added images/others/jvm-cpu-issue/jinfo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/others/jvm-cpu-issue/jstat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a9431d1

Please sign in to comment.