linux top显示java线程? [英] linux top show java threads?

查看:269
本文介绍了linux top显示java线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在linux服务器(fedora)中,我们运行一个JBOSS Application Server,并且使用石英来调度任务. 昨天

In a linux server(fedora), we run a single JBOSS Application Server, and we use quartz to schedule our task. Yesterday,

我使用top命令查看进程状态

I use a top command to view process status

查看具有不同pid的多个名为 Java 的进程.

see more than one processes named Java with different pid are displayed.

但是,如果我使用ps aux | grep java仅显示一个Java进程(Jboss AS)? 所以我的问题是:

But if i use ps aux|grep java only one java process(Jboss AS) is displayed? So my question would be:

是将Java线程映射到本地linux线程(克隆进程),还是top不显示线程?

Env:

  1. Kernerl:2.6.18
  2. JDK:1.6.0-23

推荐答案

这取决于您使用的各种工具的版本.最有可能的是,您使用的top版本无法理解Linux上线程与进程之间的关系,从而导致它错误地将每个线程显示为自己的进程. Java线程的实现取决于您的VM,但是在现代JVM和Linux版本上的典型实现是一对一,也就是说,每个Java线程都是由clone系统调用创建的Linux KSE.

It depends on your versions of various tools. Most likely, you have a version of top that doesn't understand the relationship between threads and processes on Linux, resulting in it incorrectly showing each thread as its own process. The implementation of Java threads depends on your VM, but the typical implementation on modern JVMs and Linux versions is 1-to-1, that is, each Java thread is a Linux KSE created by the clone system call.

如果您有过去三年内发布的Linux发行版,则不应该遇到此问题.

If you have a Linux distribution that came out within the past three years, you shouldn't have this issue.

这篇关于linux top显示java线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆