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
Discuss the concepts of  task decomposition  and  data decomposition  within the context of parallel programming. Parallel programming or parrelel computing is the simultaneo

Cold Backup: It is copying the three groups of files when the object is shut down. This is a straight file copy, generally from the storage disk directly to tape. You must end th

What is ERD? Entity Relationship Diagram is the graphical representation of the object relationship pair. It is mostly used in database applications.

What are batch systems? Batch systems are quite appropriate for implementing large jobs that need little interaction. The user can submit jobs and return later for the results.


The permission function is used to calculate what, if any access each class or level of user has to each file on a Unix machine. The permission task is one of the data components s

Contiguous allocation: Every file will be allocated contiguous space in the memory. Allow the block size be 1K If a 50K files desires to be allocated space after t


Write a note on multithreading. Multithreading is the capability of an operating system to execute different parts of a program called as threads, at the same time. The program