ASP Programming Question:

Download Job Interview Questions and Answers PDF

How does non-deterministic garbage collection affect my code?

ASP Programming Interview Question
ASP Programming Interview Question

Answer:

For most programmers, having a garbage collector (and using garbage collected objects) means that you never have to worry about deallocating memory, or reference counting objects, even if you use sophisticated data structures. It does require some changes in coding style, however, if you typically deallocate system resources (file handles, locks, and so forth) in the same block of code that releases the memory for an object. With a garbage collected object you should provide a method that releases the system resources deterministically (that is, under your program control) and let the garbage collector release the memory when it compacts the working set.

Download ASP Programming Interview Questions And Answers PDF

Previous QuestionNext Question
What is garbage collection?Can I avoid using the garbage collected heap?