Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Garbage Collector Threads

 
Ranch Hand
Posts: 102
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I have some questions about GC threads,

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.


Hoping for answer ranchers,

Regards,
Alim
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Alim Atar
Ranch Hand
Posts: 102
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks lot Peter for your nice answers.
 
Legend has it that if you rub the right tiny ad, a genie comes out.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic