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
The CTO is still impressed with your work. He just came back from a technology exposition where he heard about computer clusters. All he knows is that they are the big thing for bu


What is meant by arm-stickiness? If one or a few processes have a high access rate to data on single track of a storage disk, then they might be monopolizing the device by repe

Define the Communications Techniques - Application interaction protocols    Communications techniques are well defined. They give developer the programmatic mechanism to transf

Write a note on the usage of semaphores. Semaphore is a synchronization tool and it is a variable having integer values. It is accessed only by two standard atomic operations w

Q. a number of systems automatically delete all user files when a user logs off or a job terminates unless the user explicitly requests that they be kept other systems keep all fil

LINUX OPERATING SYSTEM 1. Write a brief explanation about the Linux distribution. 2. Explain the features that Bash shell provides? 3. Who is responsible for managing use

#questionThe Fibonacci sequence is the series of numbers 0,1,1,2,3,5,8,… Formally, it can be expressed as: fib0 = 0 fib1 = 1 fibn = fib n-1 + fib n-2 Write a C program u

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