简体   繁体   中英

how operating system(linux) kills java program ? What happens to the jvm when I hard kill a java process?

假设我通过发出命令kill -9 pid来杀死Java进程,jvm会停止运行还是运行垃圾收集器并回收堆中的内存,然后停止执行。

The process you're killing is the JVM process, which is running your Java code. So it has no chance to do anything at all.

Naturally, since the heap is memory that was allocated to the process, it's returned to the system's free memory pool—but not by the JVM, by the standard Linux mechanism of killing a process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM