On 17 March 2010 20:40, Lee Spector <[email protected]> wrote:
>
> Thanks Richard.
>
> The SIGQUIT thing sounds potentially useful, but when I send a SIGQUIT to the
> stuck (looping) java process it has no effect. I've tried sending SIGQUIT via
> the Max OS X Activity Monitor and also kill -3, kill -s SIGQUIT, and kill
> -SIGQUIT with the process ID from a terminal window. I know that kill -9 will
> kill it but I get no thread info. The other signals I've tried are all either
> ignored or uninformative.
I didn't know about it before Richard mentioned it, but it does seem
to work. I tried both on Linux and OS X.
e.g. in one terminal:
$ java -cp clojure.jar clojure.main
Then in another:
$ ps ax | grep java
Find the PID and then:
$ kill -QUIT <the_PID>
and I get something like this:
Full thread dump Java HotSpot(TM) Server VM (1.5.0_13-119 mixed mode):
"Low Memory Detector" daemon prio=5 tid=0x0020a700 nid=0x81ca00
runnable [0x00000000..0x00000000]
"CompilerThread1" daemon prio=9 tid=0x00209c30 nid=0x81bc00 waiting on
condition [0x00000000..0xb0c093b8]
"CompilerThread0" daemon prio=9 tid=0x00209670 nid=0x81ae00 waiting on
condition [0x00000000..0xb0b87f48]
"AdapterThread" daemon prio=9 tid=0x00209080 nid=0x815e00 waiting on
condition [0x00000000..0x00000000]
"Signal Dispatcher" daemon prio=9 tid=0x00208c30 nid=0x808600 waiting
on condition [0x00000000..0x00000000]
"Finalizer" daemon prio=8 tid=0x00208350 nid=0x819c00 in Object.wait()
[0xb0a05000..0xb0a05d90]
at java.lang.Object.wait(Native Method)
- waiting on <0x07851580> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
- locked <0x07851580> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
"Reference Handler" daemon prio=10 tid=0x00207f50 nid=0x818e00 in
Object.wait() [0xb0984000..0xb0984d90]
at java.lang.Object.wait(Native Method)
- waiting on <0x07851600> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:474)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0x07851600> (a java.lang.ref.Reference$Lock)
"main" prio=5 tid=0x00201370 nid=0xb0801000 runnable [0xb07ff000..0xb0800148]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:90)
at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:265)
at clojure.main$skip_whitespace__5866.invoke(main.clj:70)
at clojure.main$repl_read__5869.invoke(main.clj:91)
at clojure.main$repl__5879$read_eval_print__5887.invoke(main.clj:181)
at clojure.main$repl__5879.doInvoke(main.clj:200)
at clojure.lang.RestFn.invoke(RestFn.java:422)
at clojure.main$repl_opt__5914.invoke(main.clj:254)
at clojure.main$main__5940.doInvoke(main.clj:347)
at clojure.lang.RestFn.invoke(RestFn.java:398)
at clojure.lang.Var.invoke(Var.java:361)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
"VM Thread" prio=9 tid=0x002076a0 nid=0x809800 runnable
"VM Periodic Task Thread" prio=9 tid=0x0020b300 nid=0x81d800 waiting
on condition
"Exception Catcher Thread" prio=10 tid=0x002015f0 nid=0x80a800 runnable
java.io.IOException: Interrupted system call
user=>
I suppose if you've redirected stdout somewhere else it might not show
up where you expect it to. e.g. maybe SLIME interferes somehow (just
guessing).
> On Java debuggers: Is there a particular one that I ought to try? I see a big
> universe of these, but with most assuming a particular development
> environment or other setup stuff that I wouldn't know how to do from
> Clojure... Aside from minor dabbling I'm new to the Java universe.
I've never used a Java debugger, but VisualVM has been mentioned on
this list before.
http://java.sun.com/javase/6/docs/technotes/guides/visualvm/
I'm pretty sure others have been mentioned too, but I can't remember off hand.
--
Michael Wood <[email protected]>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en