Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have just compiled MongoDB in my linuxOS and not insert any data into DB.

The virtual memory is getting very large, about 40G.

ps aux|grep mongod

mongodb 176574 0.0 0.0 423784 39008 pts/308 Sl 09:00 0:00 mongod

Why does the virtual memory so huge, I haven't insert any data in it?

share|improve this question
    
423784kB/1024/1024 = 0.40GB –  edze Feb 7 at 10:46

1 Answer 1

MongoDB uses memory mapped files for performance I'll point you to a longer answer from me on this here but in essence large amounts of virtual memory usage are not something to worry about. In the case of virtual memory you'll see double usage with journaling, however this is less drastic then it sounds as the space is not actually used until there is an update. It is marked to the OS as being used despite being potentially empty when you start.

These aspects are all elements of how MongoDB uses the memory subsystem to provide performance, similarly to how it preallocates disk space to ensure these resources are marked and ready to serve your connections when they occur.

There's an interest presentation on MongoDB's storage layer that explains how the storage is managed and allocated, aggressively in most cases which tends to bump up these numbers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.