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

Address operator and pointers, We are use to using variables within C witho...

We are use to using variables within C without thinking about where they are stored. Most variables are dynamic i.e. can change, therefore they are stored in Ram, unlike a program

Operating system services, explain about oprating system services and topic...

explain about oprating system services and topics briefly

Task decomposition and data decomposition, Discuss the concepts of  task de...

Discuss the concepts of  task decomposition  and  data decomposition  within the context of parallel programming. Parallel programming or parrelel computing is the simultaneo

Total physical memory and total virtual memory , A practical task specified...

A practical task specified in the Study Guide, Computer architecture, was to record your computer's specifications. Submit the data you recorded, which will contain the following d

Define deadlock avoidance, Define deadlock avoidance. An alternative me...

Define deadlock avoidance. An alternative method for avoiding deadlocks is to need additional information about how resources are to be requested. Every request requires the sy

What are race conditions?, What are race conditions? Race conditions ar...

What are race conditions? Race conditions are problems that take place due to the sharing of the same file by several processes. In such a case none of the processes is able to

What are the three main activities of an operating system, What are the thr...

What are the three main activities of an operating system in regard to memory management? Keep track of which parts of memory are now being used and by whom. Decide which pr

Explain important fuction of virtual file system, Virtual File System serve...

Virtual File System serves two important functions. 1. It divides file-system-generic operations from their execution by defining a clean VFS interface. 2. The VFS is based

Computer organisation, basic advantage of using interrupt initiated data tr...

basic advantage of using interrupt initiated data transfer over transfer under program control without an interrupt

Multiprogramming, how response times are reduced by allowing time sharing o...

how response times are reduced by allowing time sharing on top of multiprogramming

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