【发布时间】:2020-01-14 09:04:16
【问题描述】:
在 Windows 窗体项目中,我将 gcallowverylargeobjects 属性设置为 true,并且编译器为 *64 位。 但是字节数组对象没有保存超过 2gb 的数据。
<Runtime>
<gcallowverylargeobjects enabled="true">
<\Rubtime>
我的源代码示例:
int chunk = 20971520// 20mb
int totalchunk =200; // get by run time
for(int i=0;i<totalchunk;i++)
{
Byte[] buffer = new byte[chunk];
File.readasync(buffer,0,buffer.length);
Form.add(new bytearraycontent(buffer),"file","sample");// send to post method
}
【问题讨论】:
-
“在 64 位平台上”表示计算机必须是 64 位
-
是的系统只有 64 位
-
2097150远不及 2GB...您输入错误了吗? -
@matthew 20971520 是 20mb 块。在 for 循环中多次运行直到 2gb 代码工作。之后它不会。
-
@cid 错误已清除。