Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9254535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:29:39+00:00 2026-06-18T11:29:39+00:00

MongoDB is running out of memory on a 96GB root server when adding a

  • 0

MongoDB is running out of memory on a 96GB root server when adding a single index on a timestamp field for a 50GB collection.

Does MongoDB have any option to run a query or task in “safe-mode”, e.g. without cutting the memory too much? It seems to be very touchy and can be crashed, e.g. by running some find queries with $lte/$gt on a non-indexed timestamp field.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:29:40+00:00Added an answer on June 18, 2026 at 11:29 am

    i can’t control it, but shouldn’t there a mongodb config setting for “safety” which makes sure to release RAM once it’s breaking the limit? maybe even before it is blocking other processes or stoped by oom killer?

    MongoDB does not use its own memory management. Instead it uses the OS’ LRU. The OS is paging documents so heavily because it has used the amount of memory allocated to mongod, aka your working set is bigger than the amount of RAM you have spare for MongoDB as such MongoDB is swapping page faults for most of it not all of your data ( a good reference for paging: http://en.wikipedia.org/wiki/Paging ).

    I would strongly not recommend restricting MongoDB in this case since it will run even worse however, especially on Linux, you can actually use ulimit on the mongo user you are using to run mongod: http://docs.mongodb.org/manual/administration/ulimit/

    Does MongoDB have any option to run a query or task in “safe-mode”, e.g. without cutting the memory too much?

    Not really.

    It seems to be very touchy and can be crashed, e.g. by running some find queries with $lte/$gt on a non-indexed timestamp field.

    Naturally this shouldn’t cause an OOM exception for MongoDB, it could indicate a memory leak somewhere: http://docs.mongodb.org/manual/administration/ulimit/

    If you limit the resident memory size on a system running MongoDB you risk allowing the operating system to terminate the mongod process under normal situations. Do not set this value. If the operating system (i.e. Linux) kills your mongod, with the OOM killer, check the output of serverStatus and ensure MongoDB is not leaking memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have mongodb running and using morphia. Having a Collection of BatchData Documents and
I'm running a capped collection (mongodb) with tailable cursors. It runs fine, until -
Let's say there is a running MongoDB server for a GUI client (by wxPython
I have a MongoDB server running on an 64-bit Amazon EC2 instance (journaling enabled).
I am just starting out with mongodb, but I am running into a problem
I have mongodb running on a remote server. I can ssh to the remote
I am trying to setup mongodb to test out its speed and am running
I store the system log in mongodb with building index according to 'time' field.
I've got mongodb running in following configuration: 1 config server, 2 mongos, 8 shards
I need to connect to a MongoDB instance from my EJB3 application, running on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.