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

Linux os, Introduction of linux

Introduction of linux

Explain file, What is a file? A named collection of related data explai...

What is a file? A named collection of related data explained by the creator, recorded on secondary storage.

Ipc, Explain in detail about ipc in linux

Explain in detail about ipc in linux

Linux OS, Ask questioDevelop a utility in C language which will run in Linu...

Ask questioDevelop a utility in C language which will run in Linux operating systems to display following properties of the system: ? Processor speed ? Ram size ? Computer name ? S

Hardware and software requirements for virtual memory?, What are the hardwa...

What are the hardware and software requirements for virtual memory? The hardware required for virtual memory is a secondary memory and page table. The page table should have th

Relationship among the capabilities of domain level j and i, Q. In a ring-...

Q. In a ring-protection system the level 0 has the greatest access to objects and level n (greater than zero) has fewer access rights. The access rights of a program at a partic

What is low-level formatting, What is low-level formatting? Before a di...

What is low-level formatting? Before a disk can kept data, it must be required into sectors that the disk controller can read and write. This procedure is called low-level form

Batch system, what is a batch system give me answer in simple words so that...

what is a batch system give me answer in simple words so that i can understand

Hashed page table, W hat is hashed page table & method of hashed page tabl...

W hat is hashed page table & method of hashed page table with details

Explain the statements present in assembly language, Explain the Statements...

Explain the Statements Present in Assembly Language An assembly program consists of subsequent three types of statements: a. Imperative statements: this point out an action

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