English 中文(简体)
Why do some JVM/Linux Kernels show each java thread as a process and other not? How can I determine beforehand what the behavior will be?
原标题:

I have two machines, one running 2.4.18 and one running 2.4.20. Both run Java 1.5 build 13. On one machine (2.4.18), each thread shows up as a separate process in the ps output, and on the other the whole JVM shows up as one process. What is the distinguishing factor and can I control it?

最佳回答

I believe this was to do with how the Linux kernel and/or the ps command handled multi-threaded processes. Earlier versions displayed each thread as a separate entry, newer versions merged them into one.

I was under the impression that this changed with kernel 2.6, but it seems it changed earlier than that.

I don t think there s anything you can do to fix this, short of upgrading the kernel. Perhaps an upgrade to ps might fix it, if that s actually where the problem was.

问题回答

I know thread models changed sometime around that period (e.g. 1:1 on user:kernel mappings) I don t recall however if it actually was 2.4.19+ that did it? (Don t mean to answer with another question)





相关问题
Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Is reading from an XmlDocument object thread safe?

I was wondering if i could safely read from an XmlDocument object using SelectNodes() and SelectSingleNode() from multiple threads with no problems. MSDN says that they are not guaranteed to be ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签