On Thursday, May 17, 2012 5:49:46 AM UTC-7, gopal wrote:
I Thought Since mongodb uses memory mapped files it allows other processses to use memory if they ask for it.
I suspect you need a much better knowledge of how memory architectures actually work to understand the answer to the question. Even though your mongodb process has 3GB of memory allocated, it probably isn't actively using all 3GB of that memory. The parts of memory it is actively using is known as the Resident Set Size, and is shown in some of the system performance tools as RSS.
If you are on a machine with 4GB physical RAM, and you have competing active processes both with 3GB RSS, your system perfomance is going to be terrible, as the system will have to actively swap memory pages in and out of physical memory as each becomes active. If this is true, you will absolutely want to put more memory in the machine somehow. If you're stuck with a 32-bit system, you'll want to use a PAE kernel, or switch to a 64-bit system.
If, as is likely the case, both processes have 3GB allocated but an RSS more like 1GB per process, you're probably going to be OK with your current system. The memory pages that aren't actively being used will be paged out to disk, and page faulted back into physical memory when needed.