我想看看C#数组是如何放在计算机内存中的.
我想看到的主要是两列,其中地址第二,数组元素.可能吗?
我想从1D数组开始,但后来我想观察多维数组是如何奠定的.
题
我怎样才能通过VisualStudio看到它?
我想创建两个200M int元素数组.像那样:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Arr
{
class Program
{
static void Main(string[] args)
{
int Min = 0;
int Max = 10;
int ArrSize = 200000000;
int[] test2 = new int[ArrSize];
int[] test3 = new int[ArrSize];
Console.ReadKey();
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是,在VS2013下,我出现了内存异常,黄色箭头指向上int[] test3 = new int[ArrSize];线.这台机器有12GB的RAM.
如果我将元素数量减少到150M,则不会抛出任何异常.
如果我只初始化一个大小为200M的数组,则不会抛出任何异常.
为什么?