exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 15 discussion

Actual exam question from Microsoft's 70-483
Question #: 15
Topic #: 1
[All 70-483 Questions]

You are developing an application by using C#.
The application includes an object that performs a long running process.
You need to ensure that the garbage collector does not release the object's resources until the process completes.
Which garbage collector method should you use?

  • A. ReRegisterForFinalize()
  • B. SuppressFinalize()
  • C. Collect()
  • D. WaitForFullGCApproach()
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
zzMichielzz
4 years, 7 months ago
B. Prevend the GC to dispose it immediatley
upvoted 2 times
...
lh2607
4 years, 10 months ago
B is correct
upvoted 2 times
...
Sujay
5 years ago
Why not WaitForFullGCApproach()?
upvoted 2 times
SebastianB
4 years, 5 months ago
FaitForFullGCApproach() returns only a status, doesn't settings any behaviour (https://docs.microsoft.com/en-us/dotnet/api/system.gc.waitforfullgcapproach?view=net-5.0). Also, there is written: "You need to ensure that the garbage collector does not release the object's resources until the process completes.", so, you're dealing with any 3rd party resources and those are usually managed with IDisposable pattern and with SupressFinalize() you inform CLR that you're going manage those resources by yourself release including.
upvoted 2 times
...
...
robinnirola
5 years ago
Ans B: SupressFinalize
upvoted 2 times
...
tanujgyan
5 years, 1 month ago
SupressFinalize will not let the garbage collector dispose your object
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago