{"id":15,"date":"2003-11-25T17:11:00","date_gmt":"2003-11-25T07:11:00","guid":{"rendered":"http:\/\/www.thunderguy.com\/plusplus\/20050421\/spy-on-a-java-program\/"},"modified":"2005-04-21T17:12:47","modified_gmt":"2005-04-21T07:12:47","slug":"spy-on-a-java-program","status":"publish","type":"post","link":"https:\/\/thunderguy.com\/semicolon\/2003\/11\/25\/spy-on-a-java-program\/","title":{"rendered":"Spy on a Java program"},"content":{"rendered":"<p>While a Java program is running in a console window, you can can get a stack dump of the program at any time, while it is running. This is very useful for debugging, especially for heavily multithreaded programs.<\/p>\n<p>Under Windows, just type <em>control-break<\/em> in the console of a running Java program.<\/p>\n<p>Under Linux or Unix, send a QUIT signal to the java process. You might be able to do this simply by typing <em>control-backslash<\/em> in the terminal window. If not, you need to find out the process ID of the program using <code>ps<\/code>. Then send a QUIT signal to it with<\/p>\n<pre class=\"code\">\r\n<code>kill -QUIT <em>java process pid<\/em><\/code>\r\n<\/pre>\n<p>This causes the program to output a stack dump of all running threads. This is an excellent way to find out quickly what&#8217;s going on in your program.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While a Java program is running in a console window, you can can get a stack dump of the program at any time, while it is running. This is very useful for debugging, especially for heavily multithreaded programs. Under Windows, just type control-break in the console of a running Java program. Under Linux or Unix, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[4,7],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","tag-java","tag-testing"],"_links":{"self":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":0,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"wp:attachment":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}