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
Multithreading - Operating systems that permit different parts of a software program to run concurrently. Operating systems that would come into this category are: Linux UNI

Thermostats are subjected to rigorous testing before they are shipped to air conditioning technicians around the world. Results from the last five samples are shown in the table. D

Logical File System Responsible for providing the before discussed interface to the user including: File access. Directory operations. Security and protection.

Problem: (a) Based on your experience in setting up Windows 2003 Server operating system, briefly describe the twelve different steps in which the installation is conducted du

What is reference string We evaluate an algorithm by running it on a definite string of memory reference and computing the number of page faults. The string of memory reference

Define thread cancellation & target thread. The thread cancellation is the task of terminating a thread before it has completed. A thread that is to be cancelled is often refer

Q. Describe why SSTF scheduling tends to favour middle cylinders over the innermost and outermost cylinders. Answer: The middle of the disk is the location having the smalles

Objectives 1.    Login to UNIX system and logout 2.    Learn features of the vi editor and to use online help (main pages).  Gain experience using them to create a document

Process termination A process terminates when it finishes implementing its final statement and asks the operating system to delete it by using the exit system call. At that tim

What are the system components of an operating system and explain them? a) Process management b) Main-memory management c) I/O management d) File management e) Seco