jstack

Java Swing : GUI frozen - jstack interpretation

社会主义新天地 提交于 2019-11-28 08:29:02
问题 I have a Gui application in swing that prints a ticket on a serial thermal printer. When i hit the button that launch this action, my GUI is frozen. I think that's because the code is executed on the EDT. I used jstack to be sure but i don't understand the results below : Full thread dump Java HotSpot(TM) Client VM (23.3-b01 mixed mode, sharing): "Thread-12" prio=6 tid=0x03012000 nid=0xd04 runnable [0x038ef000] java.lang.Thread.State: RUNNABLE at gnu.io.RXTXPort.eventLoop(Native Method) at

Jstack and Not enough storage is available to process this command

强颜欢笑 提交于 2019-11-28 05:20:23
I'm trying to run jstack command on my java application. Application is rather big, running inside jboss AS occupying about 4gb of memory. OS is Windows Server 2003 Standard edition. Every time i get an error "Not enough storage is available to process this command". There is enough ram, 16gb, and disk space. So, any ideas? Eric McNeill I ran into this recently on Win2008r2 and thought I'd share my solution since it took a while to figure out. Rob's comment about psexec -s is what did it for me. It appears that on Vista and later jstack doesn't work against services because of the user context

jstack: Target process not responding

岁酱吖の 提交于 2019-11-28 04:19:25
I am running Ubuntu server edition and I wanted to take a thread dump of Tomcat. So, I first tried to find out which PID tomcat uses: $ jps -l 5809 sun.tools.jps.Jps But it's not there? So, I used top instead and found out the PID 5730. Then I called jstack to get the thread dump: $ sudo jstack -l 5730 5730: Unable to open socket file: target process not responding or HotSpot VM not loaded The -F option can be used when the target process is not responding What's going on? :-( I already tried to export CATALINA_TMPDIR as described in Jstack and Jstat stopped working with upgrade to JDK6u23 but

jstack命令的使用

淺唱寂寞╮ 提交于 2019-11-28 03:17:43
jstack jstack用于生成java虚拟机当前时刻的线程快照。线程快照是当前java虚拟机内每一条线程正在执行的方法堆栈的集合,生成线程快照的主要目的是定位线程出现长时间停顿的原因,如线程间死锁、死循环、请求外部资源导致的长时间等待等。 线程出现停顿的时候通过jstack来查看各个线程的调用堆栈,就可以知道没有响应的线程到底在后台做什么事情,或者等待什么资源。 如果java程序崩溃生成core文件,jstack工具可以用来获得core文件的java stack和native stack的信息,从而可以轻松地知道java程序是如何崩溃和在程序何处发生问题。另外,jstack工具还可以附属到正在运行的java程序中,看到当时运行的java程序的java stack和native stack的信息, 如果现在运行的java程序呈现hung的状态,jstack是非常有用的。 【线程分析】 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [root@localhost bin] # jstack -help Usage: jstack [-l] <pid> (to connect to running process) jstack -F [-m] [-l] <pid> (to connect to a hung process) jstack [-m]

Extremely simple code not working in HtmlUnit

試著忘記壹切 提交于 2019-11-28 00:31:00
I'm working with HtmlUnit 2.9 (the stable version that was released this month). Do you have any idea why the following code is not working? public class Main { public static void main(String[] args) { WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3_6); webClient.setCssEnabled(true); webClient.setCssErrorHandler(new SilentCssErrorHandler()); webClient.setThrowExceptionOnFailingStatusCode(false); webClient.setThrowExceptionOnScriptError(false); webClient.setRedirectEnabled(false); webClient.setAppletEnabled(false); webClient.setJavaScriptEnabled(false); webClient

Java thread dump: BLOCKED thread without “waiting to lock …”

送分小仙女□ 提交于 2019-11-27 20:08:37
I'm having difficulties in understanding the thread dump I got from jstack for a Spring MVC web application running on Tomcat 6 (java 1.6.0_22, Linux). I see blocking threads (that cause other threads to wait) which are blocked themselves, however the thread dump doesn't tell me why or for which monitor they are waiting. Example: "TP-Processor75" daemon prio=10 tid=0x00007f3e88448800 nid=0x56f5 waiting for monitor entry [0x00000000472bc000] java.lang.Thread.State: BLOCKED (on object monitor) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3067) - locked <0x00007f3e9a0b3830> (a java

JVM监控工具介绍jstack, jconsole, jinfo, jmap, jdb, js...

时光总嘲笑我的痴心妄想 提交于 2019-11-27 17:11:33
jstack -- 如果java程序崩溃生成core文件,jstack工具可以用来获得core文件的java stack和native stack的信息,从而可以轻松地知道java程序是如何崩溃和在程序何处发生问题。另外,jstack工具还可以附属到正在运行的java程序中,看到当时运行的java程序的java stack和native stack的信息, 如果现在运行的java程序呈现hung的状态,jstack是非常有用的。目前只有在Solaris和Linux的JDK版本里面才有。 jconsole – jconsole是基于 Java Management Extensions (JMX)的实时图形化监测工具,这个工具利用了内建到JVM里面的JMX指令来提供实时的性能和资源的监控,包括了 Java 程序的内存使用,Heap size, 线程的状态,类的分配状态和空间使用等等。 jinfo – jinfo可以从core文件里面知道崩溃的Java应用程序的配置信息,目前只有在Solaris和Linux的JDK版本里面才有。 jmap – jmap 可以从core文件或进程中获得内存的具体匹配情况,包括Heap size, Perm size等等,目前只有在Solaris和Linux的JDK版本里面才有。 jdb – jdb 用来对core文件和正在运行的Java进程进行实时地调试

JVM性能调优监控工具jps、jstack、jstat、jmap、jinfo使用详解

六眼飞鱼酱① 提交于 2019-11-27 17:11:18
是什么 jps 查看所有的 jvm 进程,包括进程 ID ,进程启动的路径等等。 我自己也用 PS ,即: ps -ef | grep java jstack 观察 jvm 中当前所有线程的运行情况和线程当前状态。 系统崩溃了?如果 java 程序崩溃生成 core 文件, jstack 工具可以用来获得 core 文件的 java stack 和 native stack 的信息,从而可以轻松地知道 java 程序是如何崩溃和在程序何处发生问题。 系统 hung 住了? jstack 工具还可以附属到正在运行的 java 程序中,看到当时运行的 java 程序的 java stack 和 native stack 的信息 , 如果现在运行的 java 程序呈现 hung 的状态, jstack 是非常有用的。 jstat jstat 利用 JVM 内建的指令对 Java 应用程序的资源和性能进行实时的命令行的监控,包括了对进程的 classloader , compiler , gc 情况; 特别的,一个极强的监视内存的工具,可以用来监视 VM 内存内的各种堆和非堆的大小及其内存使用量,以及加载类的数量。 jmap 监视进程运行中的 jvm 物理内存的占用情况,该进程内存内,所有对象的情况,例如产生了哪些对象,对象数量; 系统崩溃了? jmap 可以从 core

Getting the Java thread id and stack trace of run-away Java thread

本小妞迷上赌 提交于 2019-11-27 13:00:59
问题 On my busiest production installation, on occasion I get a single thread that seems to get stuck in an infinite loop. I've not managed to figure out who is the culprit, after much research and debugging, but it seems like it should be possible. Here are the gory details: Current debugging notes: 1) ps -eL 18975 shows me the the Linux pid the problem child thread, 19269 $ps -eL | grep 18975 ... PID LWP TTY TIME CMD 18975 18994 ? 00:00:05 java 18975 19268 ? 00:00:00 java 18975 19269 ? 05:16:49

线上问题排查

走远了吗. 提交于 2019-11-27 09:47:15
转自: https://my.oschina.net/zhangxufeng/blog/3017521 Full GC次数过多 首先我们可以使用 top 命令查看系统CPU的占用情况 top - 08:31:10 up 30 min, 0 users, load average: 0.73, 0.58, 0.34 KiB Mem: 2046460 total, 1923864 used, 122596 free, 14388 buffers KiB Swap: 1048572 total, 0 used, 1048572 free. 1192352 cached Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 9 root 20 0 2557160 288976 15812 S 98.0 14.1 0:42.60 java 到了98.8%,此时我们可以复制该进程id 9 查看该进程的各个线程运行情况: top -Hp 9 该进程下的各个线程运行情况如下: top - 08:31:16 up 30 min, 0 users, load average: 0.75, 0.59, 0.35 Threads: 11 total, 1 running, 10 sleeping, 0 stopped, 0 zombie