Troubleshooting sudden high memory usage

Hi,

This morning there was an app that caused a sudden spike in I/O and memory usage in the server. We found the reason for the I/O, however the memory spike was something new, as it had never happened before.

I figured out what caused the memory spike, however, how do I investigate why the sudden memory spike (which has never happened before)?

The application is called Redmine and runs on Ruby.

Is it possible that we have to configure limits.conf? Or some file from the application side?

Best Regards,
Aigini

Thanks anaigini45 for showing/letting us know your efforts to solve this. IMHO if you know which application is culprit and I believe you are NOT owner of this, then first step we could take is reaching to customer(who is owner of application) and inform them about this, then comes discussion part with them, like how they have configured memory and other stuff in their application/programs etc.

Thanks,
R. Singh

You cannot examine events that occurred in the past unless you log your events.

You should add custom logging code to begin troubleshooting such problems.

How do you measure "memory usage"? Including cache?
I/O can increase the cache.

FYI...

There are plenty of memory profilers for Ruby.

Here is one memory profiler for Ruby, just as an example:

https://github.com/SamSaffron/memory_profiler

Are you trying to track total system memory usage? If so, why?

Let the kernel memory manager do its job. Most people would say, unused memory is wasted memory.

As MadeInGermany said, cache size will increase to improve overall system performance.

I think the OP is concerned that his application may have a memory leak (even though they did not state it directly).

Ruby is "a bit famous" for having memory leaks; and you can check this yourself by searching the net for discussions and code related to ruby memory leaks .

Since there is a lot of information on the net on Ruby and memory leaks, I think the OP may have a valid concern.

Just because Linux manages memory well, does not mean developers should ignore memory leaks, especially in a technology known for potential memory leaks.

My suggestion is that if the OP believes his Ruby app has memory leaks, he should profile it like other developers do.

The OP was looking for help and profiling the memory usage of a Ruby app is a valid form of help, so let's wait for the OP to reply.

2 Likes