问题描述
大家好,
当我在
C#中初始化一个字节数组时,我得到一个OutOfMemoryException:
Byte [] test = new Byte [420000000];
我正在使用ASP.NET 2.0。在ASP.Net 1.1中它工作正常。那么我在做什么
错了?
字节数组的最大长度是多少?
可以来人帮帮我?提前致谢!
-
Gerrit Horeis
软件开发人员
CI-Gate Development& Consulting GmbH
Hi all,
I''m getting an OutOfMemoryException when I initialize a byte array in
C# like this:
Byte[] test = new Byte[420000000];
I''m using ASP.NET 2.0. In ASP.Net 1.1 it works fine. So what am I doing
wrong?
What is the maximum length of a byte array?
Can somebody help me? Thanks in advance!
--
Gerrit Horeis
Software Developer
CI-Gate Development & Consulting GmbH
http://www.ci-gate.de
http://www.xira.de
http://www.bitbauer.de
推荐答案
我的猜测是,ASP.NET 2.0在你的应用程序允许使用多少内存方面有一些额外的限制,阻止来自
杀害机器的任性应用程序。如果我可以这样说,那是相当极端的使用
内存...
我不能说我对ASP了解多少。 NET配置 - 也许是ASP.NET组中的某个人
可以帮助你 - 但我的直觉是
这就是问题所在。
-
Jon Skeet - < sk *** @ pobox.com>
博客:
如果回复该群组,请不要给我发邮件
My guess is that ASP.NET 2.0 has some extra constraints in terms of how
much memory your app is allowed to use, to prevent wayward apps from
killing the machine. If I may say so, that''s a fairly extreme use of
memory...
I can''t say I know much about ASP.NET configuration - perhaps someone
in the ASP.NET group could help you there - but my gut feeling is
that''s where the problem is.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
我的猜测是,ASP.NET 2.0在你的应用程序允许使用多少内存方面有一些额外的限制,阻止来自
杀害机器的任性应用程序。如果我可以这样说,那是相当极端的使用
内存...
我不能说我对ASP了解多少。 NET配置 - 也许是ASP.NET组中的某个人
可以帮助你 - 但我的直觉是
这就是问题所在。
-
Jon Skeet - < sk *** @ pobox.com>
博客:
如果回复该群组,请不要给我发邮件
My guess is that ASP.NET 2.0 has some extra constraints in terms of how
much memory your app is allowed to use, to prevent wayward apps from
killing the machine. If I may say so, that''s a fairly extreme use of
memory...
I can''t say I know much about ASP.NET configuration - perhaps someone
in the ASP.NET group could help you there - but my gut feeling is
that''s where the problem is.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
这篇关于字节数组的最大大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!