user978122
user978122

Reputation: 5761

Maximum size of unmanaged object in C#

Quick question: what is the maximum size of an unmanaged object that C# can handle? I think I may have found my way around my 64-bit array problem, by making calls to a C++ dll, but I'd like to make sure.

Upvotes: 2

Views: 258

Answers (1)

Craig Stuntz
Craig Stuntz

Reputation: 126547

That's limited, in the end, by VirtualAlloc, and it depends how you use the memory, and which OS you're running. Accessing it via C#/.NET doesn't really change this. The Windows Internals book has a Testlimit[64] application which explores these limits. Read the linked post and try out the application for a complete answer.

Upvotes: 4

Related Questions