当通过大尺寸分配数组时,发生System.OutOfMemoryException. [英] The System.OutOfMemoryException happened when the array was allocated by large size.

查看:49
本文介绍了当通过大尺寸分配数组时,发生System.OutOfMemoryException.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果vertexNum为18169044.(需要207MB内存)

The crash will happened if vertexNum is 18169044.(need about 207MB memory )

Vector3包含三个 floats.

Vector3 includes three floats.

var VerNormaldata = new Vector3[ VertexNum * 2 ]; 

如何解决这个问题?


How to solve this problem ?


推荐答案

大概是在32位应用程序中执行的?然后切换到64位.

Presumably you're doing this in a 32 bit application? Switch to 64 bit then.

否则我不知道,答案很明显:使用更少的内存...

Otherwise I don't know, the answer is kind of obvious: use less memory...


这篇关于当通过大尺寸分配数组时,发生System.OutOfMemoryException.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆