1) Are Garbage collector threads(many invloed in collection) GREEN threads?
2)Does java1.6/1.7 support Greent threads?
If YES then how we can create GREEN threads?
If NO then why java stopped supporting GREEN threads?(just an overview)
3) Can we create more GC Threads ? Strange question but idea might be very useful in case of memory centric applications.
1) All threads, including GC threads, are native OS threads. At least for the Sun JVM, and I suspect for other JVMs as well.
2) I do not think so.
3) Use this option: -XX:ParallelGCThreads=N where N is the desired number of threads. Starting with JVM 5, if your system has at least 2 CPUs (or cores) and at least 2GB of RAM, then the JVM will automatically run a parallel collector for the young generation. It will assign 1 thread for each CPU up to 8, then 5 threads for every 8 CPUs after that. I suggest that you never run more GC threads than you have CPUs otherwise the collection will run slower due to the context switching among threads.