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
Problem: a) To ensure proper operation, the operating system and all the other programs must be protected from any malfunctioning program. Describe a mechanism which is impleme

ADVANTAGES OF MICROFERNEL IN YSTEM DESIGN?

Q. Distinguish among a STREAMS driver and a STREAMS module? Answer: The STREAMS driver controls the physical device that could be involved in a STREAMS operation. The STREAMS

Q. Consider a distributed system with two sites A and B. Consider whether site A can distinguish among the following: a. B goes down. b. The link between A and B goes down.

Define the WindowsNT WindowsNT provides a two-level approach to resource management: process and thread. The process is the uppermost level and contains most of the application

What do you mean by best fit? Best fit allocates the smallest hole that is big sufficient. The entire list has to be searched, until it is sorted by size. This strategy creates

Explain the various types of computer systems. Mainframe systems Large Number of CPU with Greatest Processing Power:  Huge Memory Capacity:  Increased Performance by s

Define properties of Real time operating system Real time :- Often used in a dedicated application, this system reads information from sensors and must respond within a fixed a

Briefly explain process management in Windows 2000. The Windows 2000 process manager provides for deleting, creating and using threads and processes. It has no knowledge about

What is operating system?