c# - Crash on Multidimensional Float Array Allocation -


i attempting allocate large multidimensional float array hitting out of memory exception issues when going above dimensions.

//doesn't crash float[,] newarr = new float[40000, 5000];  //crashes float[,] newarr1 = new float[45000, 5000];  //doesn't crash float[,] newarr2 = new float[40000000, 5];  //crashes float[,] newarr3 = new float[45000000, 5]; 

i not sure issue is, i'm aware of array size limits of 2gb , 4 billion elements, neither of these approaches either limit. also, cannot use data struct because need pass [,] external api call. have clue might going on here? thanks!

what have experienced code doesn't work when compiling (and running) in 32-bits mode. if switch 64-bits build mode, work.

so open project settings > compile , set platform target x64.


Comments