简体   繁体   中英

Use multi dimensional big array in C#

I want to create some big Arrays (about contained 100000*100000*100000 elements) for some tests. for example comparing between adding two arrays in parallel and serial way. but i meet this exception: Out of Memory Exception

Please Help me to complete this problem for me. thank you.

The second troubleshooting tip looks relevant: "Be sure you have enough memory to allocate for internal purposes and new managed objects". Effectively, it sounds like you need to install more memory (RAM) in your machine. Or you could allocate some smaller arrays.

As pointed out in the comments, you would need many Terabytes of memory to allocate arrays of that size. Assuming your arrays are of type int32, you could make them of size 1000 instead, which would be 4GB.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM