• Post Reply Bookmark Topic Watch Topic
  • New Topic

Garbage collection vs. Java threads  RSS feed

 
Spartak Setyan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone!
There are 5 questions I am willing to find out the answers.
As they are all connected I decided to ask without separating them and, put them in 1 topic.
  • Can the GC ever cause pause to the execution of threads?
  • What are our options as far as available garbage collectors?
  • What causes Java garbage collectors to 'thrash' and in general interrupt processing, max out memory, or max out CPU usage?
  • What the relation to number of objects, circular references; what are the limits, do different GCs have different limits? Are there ways to predict, avoid, or interrupt a GC thats in this thrashing state?
  • Are there any known bugs, problems, or pitfalls to using the Java SoftReference or HardReference in caches or similar structures; is there any corelation between them and how they relate to GCs, to threads, to web apps, or to server memory usage?

  • Any link to the related materials in internet will be appreciated.
    Thanks in advance
     
    Mr. C Lamont Gilbert
    Ranch Hand
    Posts: 1170
    Eclipse IDE Hibernate Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Can the GC ever cause pause to the execution of threads?

    Usually. there is a new concurrent GC though. but still the synchs will cause a pause if their is contention.
    What are our options as far as available garbage collectors?

    Look in the Java SDK Documentation under tools.
    What causes Java garbage collectors to 'thrash' and in general interrupt processing, max out memory, or max out CPU usage?

    design. They end up collecting everything after a certain amount of mem is used up. They tend to need better hysteresis.
    What the relation to number of objects, circular references; what are the limits, do different GCs have different limits? Are there ways to predict, avoid, or interrupt a GC thats in this thrashing state?

    Limited by amount of memory. Check the Vm specification for the particulat VM though. Sun has a VM spec, again in the Java SDK Documentation.
    Also, GC does not 'thrash.' That would imply its tripping over its feet and causing itself to slow down. Its not. its just doing its job.
    Are there any known bugs, problems, or pitfalls to using the Java SoftReference or HardReference in caches or similar structures; is there any corelation between them and how they relate to GCs, to threads, to web apps, or to server memory usage?

    Unsure the question here. SoftReferences and WeakReferences work exactly as described and I use them without issue.
    http://java.sun.com/developer/technicalArticles/ALT/RefObj/
     
    Spartak Setyan
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    CL Gilbert,
    thanks for your answer.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!