C# 应用程序可以使用多少 RAM? [英] How much RAM C# application can use?

查看:63
本文介绍了C# 应用程序可以使用多少 RAM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序包含非常大的 DataTable 对象、非常大的数组等.

I have application with very big DataTable objects, very big arrays etc.

目前我的内存使用量低于 2GB.

Currently my memory usage is below 2GB.

当我的应用程序在 32 位系统上生成 4 个大小为 1GB 的数组时会发生什么?

What will happen when my application produce 4 arrays with 1GB size on 32 bit system?

会崩溃吗?

我知道 CLR 中的 2GB 对象大小限制,但是很多大对象呢?

I know about 2GB object size limit in CLR, but what about many big objects?

我试图只是测试它,我声明了几个大数组,但是当它们为空时,它们似乎不使用 RAM.我没有试图填写他们,我决定在这里问.

I tried to just test it, I declared few big arrays, but when they are empty they seems to not use RAM. I didn't tried to fill them, i decided to just ask here.

推荐答案

64 位应用程序,包括托管应用程序,可以访问大内存.

64 bit application, including managed ones, can access large memory.

32 位应用程序的虚拟地址空间最大为 4GB.在实践中,他们默认获得 2GB./LARGEADRESSAWARE 应用程序可以在 boot.ini 中使用/3gb 获得 3GB 或在 WoW64 上运行时获得 4GB.

32 bit application have a virtual address space of maximum 4GB. In practaice they get 2GB by default. /LARGEADRESSAWARE applicaitons can get 3GB with /3gb in boot.ini or 4GB when running on WoW64.

托管应用程序,即使在 x64 上也不能分配大于 2GB 的任何单个对象.这包括数组.

Managed application, even on x64 cannot , allocate any single object larger than 2GB. That includes arrays.

但无论您可以使用多少 VA:操作 +2GB DataTable 对象是行不通的.使用能够快速处理和操作大量数据并能够智能分页的存储引擎.RedisCassandra 甚至传统的 RDBMS 更适合这项工作.

But no matter the amount of VA available at your disposal: manipulating a +2GB DataTable object is just not going to work. Use a storage engine capable of handling and manipulating large amounts of data fast, and capable of intelligent paging. Redis, Cassandra or even traditional RDBMSs are more suited for the job.

即使您决定直接在内存中操作数据,您也需要一种比DataTable更智能的格式.

Even if you decide to manipulate the data directly in memory, you need a smarter format than DataTable.

这篇关于C# 应用程序可以使用多少 RAM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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