Related to this:
System.OutOfMemoryException because of Large Dictionary
I am getting OutOfMemoryException
when I let .NET manage my dictionary. The exception thrown in resize method. So I was trying to avoid resizing by providing large number as a capacity. Naturally I tried to start from int.MaxValue
just to make sure it will help to solve the problem. I was planning to go down as much as needed.
However OutOfMemoryException
is thrown for int.MaxValue
. I decided to make a little binary search and the very first value for capacity that was accepted by constructor turned to be int.MaxValue / 32
. Not only that is smaller than I have expected but it is also just confusing.
So has anyone have any ideas why?
Oh, the project settings are setup to use x64 architecture.