Memory Overview
Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or
Already have an account? Sign In »

Video Transcription
00:00
>> Hey Cybrarians and welcome back to
00:00
the Linux+ course here at Cybrary.
00:00
I'm your instructor Rob Gills,
00:00
and in today's lesson we're going to be
00:00
talking about memory monitoring.
00:00
Upon completion of this lesson,
00:00
you're going to be able to understand
00:00
the importance of memory monitoring.
00:00
We're going to see where we can locate
00:00
memory information,
00:00
and we're going to explain the purpose of
00:00
the buffer cache and the OOM killer.
00:00
Memory monitoring is at least as
00:00
important as CPU Monitoring.
00:00
Because a well tuned CPU is not
00:00
super-helpful if the system runs out of memory.
00:00
Now we are going to cover
00:00
memory monitoring tools over the next few lessons.
00:00
But before we get into that,
00:00
before going into troubleshooting,
00:00
let's look at where we can find that memory information.
00:00
We're going to do the same thing like we did
00:00
with the CPU in the previous lesson,
00:00
and just like we saw with the CPU,
00:00
the proc directory also holds memory information.
00:00
For our purposes, we're going to be looking in
00:00
the proc mem info file
00:00
to find information about our memory.
00:00
Now just like we saw with proc CPU info,
00:00
the proc mem info file is viewable directly.
00:00
We can just cut it out or do it less,
00:00
and tools that we're going to cover later in this module,
00:00
we'll use this information in the file.
00:00
Now, processes use memory for
00:00
quicker data retrieval over going to the disk,
00:00
and this process is known as disk buffering.
00:00
It can improve disk read performance.
00:00
In this buffering, the data is
00:00
read from the disk and stored in the buffer cache,
00:00
which is actually just memory system memory,
00:00
and then subsequent access to
00:00
that data gets read from
00:00
memory instead of going to the disk.
00:00
That provides a significant performance improvement
00:00
versus going to the disk,
00:00
it's much faster to read from memory.
00:00
Now another thing we should cover when we're
00:00
talking about memory concepts before we
00:00
move forward into memory troubleshooting is
00:00
the concept of memory over commitment.
00:00
Because in Linux,
00:00
memory is allowed to be over committed to processes.
00:00
Not every process is being used and ran at the same time.
00:00
Linux can sometimes give
00:00
a little bit more memory than
00:00
actually exists on the system,
00:00
and that can improve efficiency
00:00
and performance of the system but it can
00:00
also cause the system to run critically law and
00:00
memory because it's standing out
00:00
memory doesn't actually have.
00:00
In this situation, Linux will try and reclaim
00:00
old memory pages that are no longer in use,
00:00
and if it doesn't get the system out of danger,
00:00
Linux uses something called the out of
00:00
memory or OOM killer.
00:00
The OOM killer will scan
00:00
through processes and it's going to create
00:00
a score based on total memory that's
00:00
used by the process and any of its children,
00:00
and it's going to look at the smaller number
00:00
of processes or smallest number of
00:00
processes that can be killed to get
00:00
out of the critically low memory state.
00:00
Now kernel processes or root and
00:00
crucial processes are given an intentionally low score,
00:00
and that is because the higher the score,
00:00
the more likely a process is to be killed off.
00:00
It's going to look at all the other processes that
00:00
aren't kernel root or crucial processes.
00:00
Look for the highest score and then it's
00:00
going to sacrifice that process to try
00:00
and get the system out of
00:00
that critically low memory state
00:00
and get it back operating normally.
00:00
With that, in this lesson,
00:00
we cover the importance of memory monitoring.
00:00
We talked about using the proc amendment
00:00
full file to view memory information,
00:00
and then we talked a little bit about the purpose
00:00
of the buffer cache and OOM Killer.
00:00
Thanks so much for being here and I look
00:00
forward to seeing you in the next lesson.
Up Next
Instructed By
Similar Content