Comparing gc to malloc, Operating System

Garbage collectors trade space for time. If we collect all the time (which requires a lot of processing time), the GC allocator will use the least memory possible. On the other hand, if we have a lot of space to use, we can collect very infrequently and thus be very fast. In general, with enough extra memory, GC can take almost no extra time extra, when compared to explicit memory management. For example, if we are willing to spend 4x more space than usual, garbage collection can run as fast as explicit memory management; if, on the other hand, we don't give it too much space, it will have to run very frequently and thus will demand much more processing time than
explicit memory management.

Faced with this tradeoff, when should we use a garbage collector instead of manual memory management? Generally, use a garbage collector 1) if you have lots of memory; and 2) if we really want to avoid bugs or extra programming effort related to memory management. If, however, hardware resources are the limiting factor and programmer resources are less of a limiting factor, then manual memory management is probably a better idea.

Posted Date: 3/13/2013 3:02:52 AM | Location : United States







Related Discussions:- Comparing gc to malloc, Assignment Help, Ask Question on Comparing gc to malloc, Get Answer, Expert's Help, Comparing gc to malloc Discussions

Write discussion on Comparing gc to malloc
Your posts are moderated
Related Questions
Inverted page table In page table the page table has one entry for every page that the process is using. The operating system must translate this reference into a physical memo

Q. What merit is there in having different time-quantum sizes on different levels of a multilevel queuing system? Answer: Processes that require more frequent servicing for ins

how to find ncr value in shell script

Recall that condition variables are synchronization primitives that enable threads to wait until a particular condition occurs. Generalizing, the combination of locks and condit

(Add synchronization to your solutions to HW 3 to eliminate all of the race conditions.  You should not remove any of the sleep() commands that you used to produce the race conditi

What is single and multithreading and thread pool?

Explain with an example the need of Shift Alteration in critical section problem? Consider processes P i and P j and consider the algorithm for P i and P j .

Why is it not possible to enforce memory protection at compile time?   Every process should be protected against unwanted interference by other process, whether intentional or

Problem: Managing Outside Communication. a. What is the principal action we use when communicating through a web browser? b. Give an example of how to preaddress an email

Locks (also known as mutexes, short for mutual exclusion locks) provide mutual exclusion to shared data inside a critical session. They are implemented by means of two atomic routi