小编use*_*567的帖子

如何使用超过300百万的数据创建一个数组

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace testes
{
    class Program
    {
        static void Main(string[] args)
        {
            Int64[] a = new Int64[300000000];
            a[0] = 10;

        }
    }
}
Run Code Online (Sandbox Code Playgroud)

运行此代码后,我收到一个System.OutOfMemoryException但我的计算机有8千兆ram免费.请你帮助我好吗?

我是C#的初学者.我已经将编译目标cpu更改为x64,认为只有这个就足够了.谢谢吕克

c# memory-management out-of-memory

3
推荐指数
1
解决办法
135
查看次数

标签 统计

c# ×1

memory-management ×1

out-of-memory ×1