English
Ask Your Question
0

"free" and Memory leaks?

asked 2017-11-13 21:54:18 +0000

toddandmargo gravatar image

Is there a way to use "free" or similar to notify you when memory leaks are about overwhelm your system?

I can create a cron job and eMail myself if it is time to reboot, but I do not know what to look for in "free".

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-11-14 07:15:00 +0000

masteroman gravatar image

Please be mindful that "Free" is simply unallocated memory, not necessarily all of the free/available memory you have.

People often link to the following website which explains RAM usage under Linux. It is worth taking a look in order to better understand memory management. There's more to the story, but basic stuff is simply noted there.

As for the original issue, you would better be finding the exact issue (memory leak). Pin point the application that is causing it and troubleshoot further from there. I usually use atop to periodically log resource usage, and if something goes wrong, atop usually catches the potential suspect if run often enough.

Once you find the responsible application you can either try resolving the issue within it, report the bug to the upstream or simply tweak the OOM (Out-Of-Memory) killer to kill that application first.

Having swap on the system could potentially help you in avoiding the crash and buy you some time if you notice the issue while it is happening.

edit flag offensive delete link more

Comments

From the link you gave me:

When should I start to worry?

A healthy Linux system with more than enough memory will, after running for a while, show the following expected and harmless behaviour:

    free memory is close to 0
    used memory is close to total
    available memory (or "free + buffers/cache") has enough room (let's say, 20%+ of total)

At the current time, I haven't anything other than wild speculations as to what the issue is. "atop" looks sweet.

Thank you!

toddandmargo ( 2017-11-14 09:26:57 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

Follow
1 follower

Stats

Asked: 2017-11-13 21:54:18 +0000

Seen: 28 times

Last updated: Nov 14