.Net Why can't I get more than 11GB of allocated memory in a x64 process?

前端 未结 4 530
隐瞒了意图╮
隐瞒了意图╮ 2020-12-13 16:18

I thought that the maximum user space for a 64bit process was 8TB, but I did a little test and the maximum I could get is 10-11GB.

Note: I don\'t need that much memo

4条回答
  •  臣服心动
    2020-12-13 16:34

    I'm guessing its because you're using a List, which I believe has an internal limit.

    See what you can get if you try something like creating your own old school list:

    public class ListItem
    {
        public ListItem Parent;
        public T Value;
    
        public ListItem(ListItem parent, T item)
        {
            this.Parent = parent;
            this.Value = item;
        }
    }
    

    I have written almost that exact code before (only my item was an int) and run it on a machine with 32 processors and 128 GB of ram, it always crapped out at the same size no matter what, and was always something related to Int32.MaxValue, hope that helps.

提交回复
热议问题