zoukankan      html  css  js  c++  java
  • linux查看进程内存使用情况,以及将线程情况输出文件

    用jmap把进程内存使用情况dump到文件中,再用jhat分析查看。jmap进行dump命令格式如下:

    jmap -dump:format=b,file=/tmp/dump.dat 21711  -------->进程id

    jhat -port 10099 /tmp/dump.dat

    运行在10099端口然后浏览器加端口号浏览器访问

    将线程信息

     Jstack -l PID >> 123.txt

    "startQuertz_Worker-2" prio=10 tid=0x00007fb1e1292000 nid=0x8e4e in Object.wait() [0x00007fb27cc9a000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x0000000583eb9b00> (a java.lang.Object)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
    - locked <0x0000000583eb9b00> (a java.lang.Object)

    Locked ownable synchronizers:
    - None

    "startQuertz_Worker-1" prio=10 tid=0x00007fb1e1290000 nid=0x8e4d in Object.wait() [0x00007fb27cd9b000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x0000000583eb96f0> (a java.lang.Object)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
    - locked <0x0000000583eb96f0> (a java.lang.Object)

    Locked ownable synchronizers:
    - None

    "ClientReconnectTimer-thread-2" daemon prio=10 tid=0x00007fb1d8001000 nid=0x8e2e waiting on condition [0x00007fb27ce9c000]
    java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for <0x00000005c5f30078> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1085)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:807)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

  • 相关阅读:
    C++17 filesystem文件系统
    简易版本vue的实现
    javaSE基础04
    javaSE基础03
    javaSE基础02
    JavaSE基础01
    Document对象和window对象
    进程和子进程及端口的常用命令
    vue分页组件二次封装---每页请求特定数据
    css图片垂直水平居中及放大(实现水平垂直居中的效果有哪些方法?)
  • 原文地址:https://www.cnblogs.com/AnonymouL/p/10973466.html
Copyright © 2011-2022 走看看