Question

I've created my first "real" java program and running it for the first time on a production server. What I've noticed is that running the jar (java -jar foo.jar) on ubuntu spawns around 13 processes, while running it on my mac only spawns one process (which is expected imo due to the fact that I only spawn one thread in the app).

What could explain this difference?

Was it helpful?

Solution

As Thilo suggested, I believe what you're seeing are not multiple processes but threads. Linux' top by default shows individual threads and their usages.

The htop tool (apt-get install htop) has the ability to hide these "Userland threads" and group the resource usage back into a single entry per process.

> htop
> F2 to open options
> Display options
> Hide userland threads (space to toggle)
> F10, Esc or q to return to display
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top