Command ‘mapreduce’ failed: too much data for in memory map/reduce

I used MapReduce but during the execution, I got an error:

MongoDB.Driver.MongoCommandException: Command 'mapreduce' failed: too much data for in memory map/reduce (response: { "ok" : 0.0, "errmsg" : "too much data for in memory map/reduce", "code" : 13604, "codeName" : "Location13604"

What is the root cause of this problem, and is there any solution?

Thank you

Hi there!

I suspect you may be using the option {out:{inline:1}} which performs MR in memory and then attempts to return the result as a single document. I have some questions for you:

  1. what version are you running?
  2. how come you are using MapReduce rather than much faster aggregate command?

If you provide the full command you are running, I can confirm the cause of the error message, and maybe help you use aggregate instead of mapReduce for this?

Asya