I run a very simple, single-threaded java program. When I check the threads using command under Ubuntu
ps -eLf
it shows there are 14 threads at OS level. I expect there is only one thread when the program has one thread, and x threads if the program has x threads. Is my expectation wrong?
The JVM has its own threads, such as the garbage collector. Try doing a
kill -3 <pid>on it, and it will show you all the threads.