HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Memory being abruptly freed up every day at about the same time

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
sametheeverytimebeingabruptlymemoryaboutdayfreed

Problem

I have a few VMs on Windows Azure that run our ecommerce website, and lately we started using Telegraf, InfluxDb and Grafana to keep an eye on these machines. After a couple weeks of gathering data, I have noticed a weird pattern related to the Memory Available metric:

Everyday almost always at the same period of the day, I have noticed that there is an abrupt amount of memory being freed up which, due to my very very very limited DevOp skills, I cannot figure out what is causing this.

Here's a chart that shows this pattern:

My question is: What could lead to something like this? I feel tempted to suspect that a Memory Leak is to blame but...Free memory never drops below 70% and only happens in two of the VMs with the most traffic!

Should I be concerned when I see something like this?

P.S.: I have stared gathering metrics for Private e Virtual bytes for each of the windows services we have running and for the w3wp process...although I have read that this metrics are not very reliable to find out if you have a memory leak, but at least I'll try to get some sort of trend and see if it correlates with the pattern shown above.

Solution

I've seen this same "sawtooth" pattern in other systems, in particular a Java-based data tool. Based on your description, I think you're looking at .NET garbage collection (assuming this is a .NET app.) Java and .NET are both memory-managed languages and frameworks that use garbage collection.

A memory leak is typically found in frameworks that lack memory management, or in a program on a memory-managed framework that is overriding or confusing the garbage collector.

The fact that these are your highest-traffic servers makes sense. You're seeing the .NET framework allocate memory as needed, then the garbage collector kicks in on a regular cycle and reclaims unused memory using the garbage collection algorithms. Unless you're tracking specific performance issues I don't think this memory usage pattern is a problem.

Context

StackExchange DevOps Q#1125, answer score: 7

Revisions (0)

No revisions yet.