堆叠容量在C# [英] Stack capacity in C#

查看:282
本文介绍了堆叠容量在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能告诉我堆栈容量在C#中的东西。

Could someone tell me what the stack capacity is in C#.

我想,形成三维网状闭合对象使用30000项的数组。

I am trying to form a 3D mesh closed object using an array of 30,000 items.

推荐答案

对于.NET应用程序的默认堆栈大小为1 MB(默认为256 KB的32位ASP.NET应用程序和512 KB的64位ASP .NET应用程序),但你可以改变这一点。对于应用程序,你可以通过修改可执行文件的PE头更改默认大小。为您创建线程,您可以使用构造函数重载需要一个堆栈大小。

The default stack size for a .NET application is 1 MB (default is 256 KB for 32-bit ASP.NET apps and 512 KB for 64-bit ASP.NET apps), but you can change that. For the application you can change the default size by modifying the PE header of the executable. For threads you create, you can use the constructor overload that takes a stack size.

不过,安东Tyjhyy指出,在他的回答中,数组是引用类型,因此位于堆(即使阵列恰好容纳一堆值类型)。

But as Anton Tyjhyy points out in his answer, arrays are reference types and thus located on the heap (even if the array happens to hold a bunch of value types).

这篇关于堆叠容量在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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