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)

  • 相关阅读:
    Mysql设置字段唯一,值唯一方式
    在tomcat中模块化部署项目
    优化Eclipse
    akka 服务的搭建
    ES6中的let和var区别
    jquery,$,选择器,正则表达式
    jsp页面用java代码取随机数
    为什么要做权限管理
    将字符串编码成数值,求数值最大和问题
    Cookie与Session的区别
  • 原文地址:https://www.cnblogs.com/AnonymouL/p/10973466.html
Copyright © 2011-2022 走看看