Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Understanding Memory Utilization in RavenDB

DZone's Guide to

Understanding Memory Utilization in RavenDB

We take a look at a production instance of RavenDB to have a look at what its resource utilization is like. It might surprise you a bit.

· Database Zone ·
Free Resource

RavenDB vs MongoDB: Which is Better? This White Paper compares the two leading NoSQL Document Databases on 9 features to find out which is the best solution for your next project.  

This is a snapshot of our production server right this moment. As you can see, the system is now using every little bit of RAM that it has at its disposal. You can also see that the CPU is kind of busy and the network is quite active.

image

In most cases, an admin seeing this will immediately hit the alarm bell and start figuring out what is causing the system to use all available memory. This looks like a system that is on the precipice of doom, after all.

However, this is a system that is actually:

  • Working as intended
  • Is quite fast
  • Have plenty of extra headroom to spare

The problem is that the numbers, as you see them here, are lying to you. The system is using 3.9 GB of memory but look at the committed value. There are only 2.6GB that are actually committed. Memory internals are complex, but basically, this means that the system needs to find a place in RAM and on the page file for a 2.6GB. But what about all the other stuff? That is being used, but it isn’t held back from the system if we need it. RavenDB is making active use of all the memory that is available in the system by way of memory mapped files. Let’s see what the RAMMap tool (which is great is diagnosing such issues) tells us:

image

Out of a total of 4GB on this machine, about 2.5 GB that are actually in memory are memory mapped files — out of which we have 1.3 GB in the active set (so they are actively worked on), but we also have 1.1GB here that are in the Standby column.

What this means is that this memory that is in the OS can just repurpose without any extra costs attached. Note that the amount of modified memory (which will require us to write it out to disk) is really small.

This is a good place to be at, even if at first glance, it was quite surprising to see.

Do you pay to use your database? What if your database paid you? Learn more with RavenDB.

Topics:
database ,ravendb ,memory utilization ,database performance ,optimization

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}