cancel
Showing results for 
Search instead for 
Did you mean: 

Mongo DB sort operation gives error "Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit."

Santosh_Yadav
Champ on-the-rise
Champ on-the-rise

Hi, I am having complex hierarchy of document up to 20 levels. And more than 1lakh of document. While I am accessing inner most level of document getting error.

** com.mongodb.MongoQueryException: Query failed with error code 96 and error message 'errmsg: "Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit."' on server hydprdmsdb4:27020**

Can any one solve this.

7 REPLIES 7

Victor_Sánchez
Confirmed Champ
Confirmed Champ

Hi,

You can do, for example for 50MB blocking sort:

> mongo <your-server-and-port>
> use admin
> db.adminCommand({setParameter: 1, internalQueryExecMaxBlockingSortBytes:50151432})

Regards, VS.

Hi,

Please, check your mongodb parameters after changes and verify about internalQueryExecMaxBlockingSortBytes param.

Hi,