Programming in C# — Question 71

You are debugging a 64-bit C# application.
Users report System.OutOfMemoryException exceptions. The system is attempting to use arrays larger than 2 GB in size.
You need to ensure that the application can use arrays larger than 2 GB.
What should you do?

Answer options

Correct answer: C

Explanation

The correct answer is C because setting the gcAllowVeryLargeObjects property to true allows the application to allocate arrays larger than 2 GB. Option A is incorrect as the /3GB switch is not applicable for 64-bit applications. Option B, while related to large address awareness, is not the correct solution for this specific scenario. Option D does not directly address the application's configuration for large arrays.