nerdexam
Microsoft

98-372 · Question #4

Which method is used to initiate a cleanup of a heap?

The correct answer is A. Collect. The Collect method is used to initiate a cleanup of a heap. This method is part of the GC (garbage collector) class. Garbage collection is a process of reclaiming the memory resources used by an object. An object not referenced by any variable becomes eligible for garbage…

Understanding Cloud Concepts

Question

Which method is used to initiate a cleanup of a heap?

Options

  • ACollect
  • BGCCollectionMode
  • CKeepAlive
  • DWaitForPendingFinalizers

How the community answered

(19 responses)
  • A
    79% (15)
  • B
    5% (1)
  • C
    5% (1)
  • D
    11% (2)

Explanation

The Collect method is used to initiate a cleanup of a heap. This method is part of the GC (garbage collector) class. Garbage collection is a process of reclaiming the memory resources used by an object. An object not referenced by any variable becomes eligible for garbage Answer: D is incorrect. The WaitForPendingFinalizers method is used to suspend the current thread until the thread that is processing the queue of finalizers has emptied that queue. Answer: B is incorrect. GCCollectionMode is an enumeration that is used to indicate the behavior for a forced garbage collection. Answer: C is incorrect. The KeepAlive method is used to ensure that the existence of a reference to an object that is at risk of being prematurely reclaimed by the garbage collector.

Topics

#.NET Framework#garbage collection#memory management#GC.Collect

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice