Mongo can't map file memory error


#1

I’m trying to perform a large migration of data using a meteor app. When I run it locally, I get the following error:

MongoError: can’t map file memory - mongo requires 64 bit build for larger datasets

Does that mean:

  1. The local mongo instance is our of memory
  2. The app itself is out of memory
  3. Something else

It’s fine if it’s a local testing issue. I’m just scared that when I go to run this on the production database that it’s going to explode mid-migration. (the production DB is hosted at compose.io)

Also note that the migration code fetches documents in small groups using skip and limit to avoid dumping the whole DB into my app’s memory.


#2

Seems like this is a 32 bit Mongo DB.
Mongo use system memory map to load data to RAM.
In 32 bit version, (due to 32 address space limitations) it can’t map large data blocks.

That’s the issue.


#3

Well the good news is that in production it actually worked fine so it was just an issue with the test instance running a 32-bit binary. What I don’t get is why a DB with only a couple hundred MB of data would cause this kind of failure even when using a working set of a few thousand documents… but I suppose that’s outside the context of this forum.


#4

but I suppose that’s outside the context of this forum.

Yeah! I think :slight_smile: