问题描述
我的 linux 机器上的 Htop 在启动一个 java 程序/JVM 后显示了许多进程".我确实了解 JVM 运行多个线程(用于实际程序、垃圾收集等).
Htop on my linux machine shows many "processes" after launching one java program/JVM. I do understand that the JVM runs multiple threads (for the actual program, for garbage collection, etc).
但是为什么 htop 将它们列为具有不同 pid 的多个进程.这些过程究竟是什么?
But how come htop lists them as multiple processes with different pids. What exactly are those processes?
推荐答案
其实只是htop默认将每个线程显示为一个单独的进程.您可以将行 hide_userland_threads=1
添加到您的 ~/.config/htop/htoprc
文件中以仅显示一行.
Actually, it's just that htop by default shows each thread as a separate process. You can add the line hide_userland_threads=1
to your ~/.config/htop/htoprc
file to show only one line.
请参阅 https://unix.stackexchange.com/questions/10362/why-does-htop-show-more-process-than-ps
这篇关于Htop 显示具有不同 pid 的多个 java 进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!