Look at the top and htop commands and how to use them to get memory usage information.
- [Instructor] Let's look at our memleak.c file,…and we see it loops 30 times, mallocing 100 meg each time,…with a sleep in between, so it's going to run…something over 30 seconds.…And we're going to run that, and while it's running,…we're going to look at top and htop.…And to make sure we have enough time,…I'm just going to run it in a loop.…So while true do memleak done.…
All right, so that's running in this window.…I'll switch over to another window and I'll run top,…and top is now sorting by percent CPU…and memleak doesn't seem to be using a lot of CPU there.…So we're going to switch to percent memory so we do a little f…and we get the list, down arrow brings us brings us…to percent mem, and if you read the little list…on top of directions we see we need to do a right arrow…to select, then a left arrow to commit,…than as S to say we want to sort on that,…and then an escape.…
Now we're sorting on percent mem…and memleak's way up there at the top,…using over 30%.…And then memleak went away, we got a new memleak,…
- Timing techniques
- Packages for performance
- Identifying and optimizing CPU bottlenecks
- Finding memory bottlenecks
- Diagnosing disk bottlenecks
Skill Level Intermediate
Learning Linux Shell Scripting (2017)with Sarath Lakshman8h 19m Intermediate
1. Performance Overview
2. CPU Bottlenecks
3. Memory Bottlenecks
4. Disk Bottlenecks
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.