I would like to terminate the Java application when 'kill -s 3 ' is executed. But Java dumps the thread information instead. Do I need to use different kill signal?
Asked
Active
Viewed 1,816 times
1
-
what **resource** you want to clean up using shutdownhook? – PankajSays Nov 12 '13 at 18:13
3 Answers
0
take a look at this: How to stop java process gracefully?
kill -3 or kill -s 3 will always generate the thread dump.
In general programming, finalizer and shutdownhooks should not be used.

Community
- 1
- 1

PankajSays
- 965
- 1
- 9
- 12
0
According to JVMs and kill signals, the ShutdownHook is not run and the jvm is not shutdown when using signal SIGQUIT (3). Just use the default signal SIGTERM (15).

Michael Konietzka
- 5,419
- 2
- 28
- 29