Comparing gc to malloc, Operating System

Assignment Help:

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.


Related Discussions:- Comparing gc to malloc

Explain secondary-storage management, What are the three main activities of...

What are the three main activities of an operating system in regard to secondary-storage management? a) Free-space management. b) Storage allocation. c) Disk scheduling.

Buffer, Ask question #Minimum 100 words accepted application of bounded and...

Ask question #Minimum 100 words accepted application of bounded and unbounded buffers

Microsoft, Discuss the high barriers to entry in the market for PL operatin...

Discuss the high barriers to entry in the market for PL operating systems

Logic gates, Determine the equation for the y and truth table for the circu...

Determine the equation for the y and truth table for the circuits

File management, approaches to identify free memory area in a heap

approaches to identify free memory area in a heap

Transportation, what are the factors influencing the choice of a mode of tr...

what are the factors influencing the choice of a mode of transportation?

CPU sheduling, categorize the CPU scheduling algorithms and among them expl...

categorize the CPU scheduling algorithms and among them explain the non-preemptive algorithms..

Explain briefly the working of semaphore with example ?, Explain briefly th...

Explain briefly the working of semaphore with example ? The E.W. Dijkstra (1965) abstracted the key idea of mutual exclusion in his concepts of semaphores. Definition A s

What advantages are there to this two-level directory, What advantages are ...

What advantages are there to this two-level directory? Users are isolated from each other. Users have more freedom in choosing file names.

How is the NTFS namespace planned, Q. How is the NTFS namespace planned? Ex...

Q. How is the NTFS namespace planned? Explain. Answer: The NTFS namespace is prearranged as a hierarchy of directories where every directory uses a B+ tree data structure to

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd