为什么32位计算机上的mongodb的数据大小限制为2GB而不是4GB? [英] why mongodb on 32-bit machine has limitation of datasize to 2GB , not 4GB?

查看:179
本文介绍了为什么32位计算机上的mongodb的数据大小限制为2GB而不是4GB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处所述,mongodb具有局限性在具有一个mongod实例的32位计算机中,将数据大小扩展为2GB.但是我不知道32位计算机理论上是否具有4GB可寻址空间,而mongod可以使用这4GB而不是2GB的虚拟内存.那么,为什么答案是2GB,而不是4GB?

as here mention, mongodb has limitation of datasize to 2GB in 32-bit machine with one single mongod instance. But I wonder 32-bit machine has 4GB addressable space in theory, and mongod can use this 4GB instead of 2GB for virtual memory usage. So why the answer is 2GB, not 4GB?

推荐答案

4Gb的可寻址空间与可用于用户应用程序打开的内存映射文件的内存空间不同.一些可寻址空间是为O/S内核和内存映射设备(例如视频卡)保留的.

4Gb of addressable space is not the same as the memory space available for memory-mapped files opened by user applications. Some of the addressable space is reserved for the O/S kernel and memory-mapped devices such as video cards.

例如,32位Windows将用户模式(因此将内存映射文件)限制为〜2Gb RAM,将系统总RAM限制为〜3.5Gb.

For example, 32-bit Windows limits user mode (and thus memory-mapped files) to ~2Gb RAM and total system RAM to ~3.5Gb.

有关更多阅读,请参阅:

For more reading, see:

  • Coding Horror: Dude, Where's My 4 Gigabytes of RAM?
  • MSDN: Managing Memory-Mapped Files
  • MSDN: Memory-Mapped Files

大约十年前,大多数现代台式机和服务器环境开始转向64位(请参阅 Wikipedia上的64位操作系统时间轴),因此这实际上并不会影响部署.

The majority of modern desktop and server environments starting moving to 64-bit almost a decade ago (see 64-bit operating system timeline on Wikipedia) so this isn't a limit that practically affects deployment.

您只想在数据有限的开发环境中使用32位MongoDB.

You would only want to use 32-bit MongoDB in a development environment with limited data.

这篇关于为什么32位计算机上的mongodb的数据大小限制为2GB而不是4GB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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