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 the grouping threads that execute similar functions, Grouping Threa...

Grouping Threads That Execute Similar Functions   Thread Groups are generally used to group threads that execute similar functions of the application program. For instance, if

Explain lru second chance algorithm, Second chance Algorithm When the p...

Second chance Algorithm When the page is chosen the reference bit is checked to see whether it has been referenced before. If that is the case after that it is given a second c

Describe internal layout of the file system in windows 2000, Describe the i...

Describe the internal layout of the file system in windows 2000. The basic entity in NTFS is a volume and a volume is created by the Windows 2000 disk administrator utility and

Memory organization and decoding, In a  p system each part (RAM, ROM, I/O) ...

In a  p system each part (RAM, ROM, I/O) has a unique set of numbers. The allocation of these numbers is usually stated in the form of a memory map. This is a plot of data bus agai

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

Explain about interprocess communication, Explain about interprocess commun...

Explain about interprocess communication The cooperating processes communicate with each other via an interprocess communication facility. IPC gives a mechanism to permit proce

Explain internal file structure, Internal file structure All disk I/O i...

Internal file structure All disk I/O is performed in units of single block, and all blocks are the similar size. It is unlikely that the physical record size will exactly match

Explainoptimal page replacement in detail, Optimal page replacement An...

Optimal page replacement An optimal page replacement algorithm has the least page fault rate of all algorithms. The algorithm states that put back the page that will not be us

How program execute in operating system, Q. How Program execute in operatin...

Q. How Program execute in operating system? Program execution: Operating system loads a program in memory and executes the program. The program should be able to end its exec

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