- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试获取/分析我在 Linux 机器上的 Glassfish 3.1.1 中运行的应用程序的线程转储。我遇到过两种方法。
kill -QUIT <pid>
在命令行上这两个线程转储的结果是不同的。 kill 方法生成一个文件 (/domains/domain1/logs/jvm.log),它是 XML (hotspot_log) 并且具有以下结构:
<?xml version='1.0' encoding='UTF-8'?>
<hotspot_log version='160 1' process='9426' time_ms='1328662710633'>
<vm_version>
<name>Java HotSpot(TM) 64-Bit Server VM</name>
<release>17.0-b16</release>
<info>
Java HotSpot(TM) 64-Bit Server VM (17.0-b16) for linux-amd64 JRE (1.6.0_21-b06),
built on Jun 22 2010 01:10:00 by "java_re" with gcc 3.2.2
(SuSE Linux)
</info>
</vm_version>
<vm_arguments>
<args>
-XX:+UnlockDiagnosticVMOptions -XX:MaxPermSize=192m -XX:NewRatio=2 -XX:+LogVMOutput
... SNIP ...
</args>
<command>
... SNIP ...
</command>
<launcher>
SUN_STANDARD
</launcher>
<properties>
java.vm.specification.version=1.0
... SNIP ...
</properties>
</vm_arguments>
<tty>
<writer thread='1085897024' />
<dependency_failed type='unique_concrete_method'
x='java/lang/ThreadLocal getMap (Ljava/lang/Thread;)Ljava/lang/ThreadLocal$ThreadLocalMap;'
witness='java/lang/InheritableThreadLocal' stamp='1.955' />
<dependency_failed type='unique_concrete_method'
x='java/lang/ThreadLocal getMap (Ljava/lang/Thread;)Ljava/lang/ThreadLocal$ThreadLocalMap;'
witness='java/lang/InheritableThreadLocal' stamp='1.955' />
<dependency_failed type='unique_concrete_method'
x='java/lang/ThreadLocal getMap (Ljava/lang/Thread;)Ljava/lang/ThreadLocal$ThreadLocalMap;'
witness='java/lang/InheritableThreadLocal' stamp='1.955' />
<dependency_failed type='unique_concrete_method'
x='java/lang/ThreadLocal getMap (Ljava/lang/Thread;)Ljava/lang/ThreadLocal$ThreadLocalMap;'
witness='java/lang/InheritableThreadLocal' stamp='1.955' />
... SNIP ...
<writer thread='1106913600' />
2012-02-08 09:54:18
Full thread dump Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode):
"pool-28-thread-1" prio=10 tid=0x00002aaae959c800 nid=0x28d5
runnable [0x0000000049da0000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
- locked <0x00002aaab547d7f0> (a java.io.BufferedInputStream)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at
... SNIP ...
注意结束标签
</tty>
</hotspot_log>
文件中缺少。 有人知道为什么吗?
通过管理控制台完成的转储生成具有以下格式的报告:
server
View:
Full Java Thread Dump Java HotSpot(TM) 64-Bit Server VM 17.0-b16 Sun Microsystems Inc.
Number of threads: 97
Number of daemon threads: 83
Peak live thread count since the Java virtual machine started or peak was reset: 116
Is support for thread contention monitoring available on this JVM? [true]
Is thread contention monitoring enabled? [false]. If false, some thread synchronization statistics are not be available.
Is support for CPU time measurement for any thread available on this JVM? [true]
Is thread CPU time measurement enabled? [true]. If false, thread execution times are not available for any thread.
--------------------------------------------------------------------------------
Thread Execution Information:
-----------------------
Thread "Ejb-Timer-Thread-103" thread-id: 616 thread-state: TIMED_WAITING Waiting on lock: java.util.concurrent.SynchronousQueue$TransferStack@28ee94c8
at: sun.misc.Unsafe.park(Native Method)
at: java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
at: java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
at: java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
at: java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
at: java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)
at: java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at: java.lang.Thread.run(Thread.java:619)
Thread Synchronization Statistics:
-----------------------
Number of times this thread was blocked (to enter/reenter a Monitor): 0
Number of times this thread waited for a notification (i.e. it was in WAITING or TIMED_WAITING state): 20
Total CPU time for this thread: 0 seconds 0 nanoseconds.
User-level CPU time for this thread: 0 seconds 0 nanoseconds.
Object Monitors currently held or requested by this thread: []
Ownable Synchronizers (e.g. ReentrantLock and ReentrantReadWriteLock) held by this thread: []
--------------------------------------------------------------------------------
Thread Execution Information:
-----------------------
Thread "RMI TCP Connection(206)-127.0.0.1" thread-id: 613 thread-state: RUNNABLE Running in native
at: java.net.SocketInputStream.socketRead0(Native Method)
at: java.net.SocketInputStream.read(SocketInputStream.java:129)
at: java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at: java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at: java.io.DataInputStream.readUnsignedShort(DataInputStream.java:320)
at: java.io.DataInputStream.readUTF(DataInputStream.java:572)
at: java.io.DataInputStream.readUTF(DataInputStream.java:547)
at: sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:774)
at: sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at: java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at: java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at: java.lang.Thread.run(Thread.java:619)
Thread Synchronization Statistics:
-----------------------
Number of times this thread was blocked (to enter/reenter a Monitor): 0
Number of times this thread waited for a notification (i.e. it was in WAITING or TIMED_WAITING state): 0
Total CPU time for this thread: 0 seconds 0 nanoseconds.
User-level CPU time for this thread: 0 seconds 0 nanoseconds.
Object Monitors currently held or requested by this thread: []
Ownable Synchronizers (e.g. ReentrantLock and ReentrantReadWriteLock) held by this thread: []
--------------------------------------------------------------------------------
... SNIP ...
No deadlock found
为了分析转储,我尝试了 TDA - Thread Dump Analyzer (http://java.net/projects/tda/) 并发现它会打开 XML 版本,但不会在 UI 中显示直到我也打开一个非 XML 版本(然后两者都会显示)。
为什么格式如此不同?一个比另一个更适合分析吗?重要吗?
最佳答案
您可以在 glassfish v3.1 中使用以下命令生成线程转储报告:
asadmin generate-jvm-report --type=thread
引用:
http://docs.oracle.com/cd/E18930_01/html/821-2436/ghuvy.html
关于java - Glassfish v3 - 如何获取/分析线程转储?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9199324/
我刚刚继承了一个旧的 PostgreSQL 安装,需要进行一些诊断以找出该数据库运行缓慢的原因。在 MS SQL 上,您可以使用 Profiler 等工具来查看正在运行的查询,然后查看它们的执行计划。
将目标从Analytics(分析)导入到AdWords中,然后在Analytics(分析)中更改目标条件时,是否可以通过更改将目标“重新导入”到AdWords,还是可以自动选择? 最佳答案 更改目标值
我正在使用google analytics api来获取数据。我正在获取数据,但我想验证两个参数,它们在特定日期范围内始终为0。我正在获取['ga:transactions']和['ga:goalCo
我使用Google API从Google Analytics(分析)获取数据,但指标与Google Analytics(分析)的网络界面不同。 即:我在2015年3月1日获得数据-它返回综合浏览量79
我在我的Web应用程序中使用sammy.js进行剔除。我正在尝试向其中添加Google Analytics(分析)。我很快找到了following plugin来实现页面跟踪。 我按照步骤操作,页面如
当使用 Xcode 分析 (product>analyze) 时,有没有办法忽略给定文件中的任何错误? 例如编译指示之类的? 我们只想忽略第三方代码的任何警告,这样当我们的代码出现问题时,它对我们
目录 EFK 1. 日志系统 2. 部署ElasticSearch 2.1 创建handless服务 2.2 创建s
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
GCC/G++ 是否有可用于输出分析的选项? 能够比较以前的代码与新代码之间的差异(大小、类/结构的大小)将很有用。然后可以将它们与之前的输出进行比较以进行比较,这对于许多目的都是有用的。 如果没有此
我正在浏览 LYAH,并一直在研究处理列表时列表理解与映射/过滤器的使用。我已经分析了以下两个函数,并包含了教授的输出。如果我正确地阅读了教授的内容,我会说 FiltB 的运行速度比 FiltA 慢很
在 MySQL 中可以使用 SET profiling = 1; 设置分析 查询 SHOW PROFILES; 显示每个查询所用的时间。我想知道这个时间是只包括服务器的执行时间还是还包括将结果发送到前
我用 Python 编写了几个用于生成阶乘的模块,我想测试运行时间。我找到了一个分析示例 here我使用该模板来分析我的模块: import profile #fact def main():
前几天读了下mysqld_safe脚本,个人感觉还是收获蛮大的,其中细致的交代了MySQL数据库的启动流程,包括查找MySQL相关目录,解析配置文件以及最后如何调用mysqld程序来启动实例等,有着
1 内网基础 内网/局域网(Local Area Network,LAN),是指在某一区域内有多台计算机互联而成的计算机组,组网范围通常在数千米以内。在局域网中,可以实现文件管理、应用软件共享、打印机
1 内网基础 内网/局域网(Local Area Network,LAN),是指在某一区域内有多台计算机互联而成的计算机组,组网范围通常在数千米以内。在局域网中,可以实现文件管理、应用软件共享、打印机
我有四列形式的数据。前三列代表时间,value1,value 2。第四列是二进制,全为 0 或 1。当第四列中对应的二进制值为0时,有没有办法告诉excel删除时间、值1和值2?我知道这在 C++ 或
我正在运行一个进行长时间计算的 Haskell 程序。经过一些分析和跟踪后,我注意到以下内容: $ /usr/bin/time -v ./hl test.hl 9000045000050000 Com
我有一个缓慢的 asp.net 程序正在运行。我想分析生产服务器以查看发生了什么,但我不想显着降低生产服务器的速度。 一般而言,配置生产盒或仅本地开发盒是标准做法吗?另外,您建议使用哪些程序来实现这一
我目前正在尝试分析 Haskell 服务器。服务器永远运行,所以我只想要一个固定时间的分析报告。我尝试只运行该程序 3 分钟,然后礼貌地要求它终止,但不知何故,haskell 分析器不遵守术语信号,并
是否有工具可以分析 Maven 构建过程本身,以便我可以看到构建花费最多时间的地方? 我们在工作中遇到了关于 Maven 3.0.3 和 3.0b1 的问题。与 3.0.3 (9m00s) 相比,我们
我是一名优秀的程序员,十分优秀!