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
What are batch systems? Early computers were physically huge machines run from a console. The general input devices were card readers and tape drivers. The common output device

Optimal page replacement An optimal page replacement algorithm has the least page fault rate of all algorithms. The algorithm states that a 'replace the page that will not be

Lexical substitution during macro expansion Lexical substitution is employed to produce an assembly statement from a model statement. A model statement contains 3 types of stri

LOOK o Like SCAN except stops moving inwards (or outwards) when no more requests in that direction exist. C-SCAN (circular scan) o Moves inwards servicing requests u

Q. Process migration in a heterogeneous network is typically impossible given the differences in architectures and operating systems. Explain a method for process migration across

What are the various file operations? The six basic file operations are Creating a file Reading a file Writing a file Repositioning within a file Tr

Q. What are the major differences between operating systems for mainframe computers and personal computers? Answer: In general operating systems for batch systems have simpler

Suppose we have 3 processes running at the same time as shown in the following table. Each resource only has one instance. Show a possible scenario of resource allocation that r

difference between process and thread

What is degree of multiprogramming ? Degree of multiprogramming signifies the number of processes in memory. If the degree of Multiprogramming is steady after that the average