How Much of an Operating System is Loaded in Memory?

Issues and / or general discussion relating to Puppy


Moderator: Forum moderators

Post Reply
JusGellin
Posts: 851
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 112 times
Been thanked: 114 times

How Much of an Operating System is Loaded in Memory?

Post by JusGellin »

How can I find how much is loaded into memory and how much is loaded in drive storage?

Sometimes it is stated that everything is loaded into memory. How can this be determined?

Thanks

User avatar
pp4mnklinux
Posts: 1317
Joined: Wed Aug 19, 2020 5:43 pm
Has thanked: 684 times
Been thanked: 330 times

Re: How Much of an Operating System is Loaded in Memory?

Post by pp4mnklinux »

There are a lot of methods... the fastest: free -h

The more informative: HARD_INFO
Menu Settings HardInfo

Hope it helps

Attachments
Screenshot_2025-02-09_11-17-36.jpg
Screenshot_2025-02-09_11-17-36.jpg (11.47 KiB) Viewed 566 times
Screenshot_2025-02-09_11-17-14.jpg
Screenshot_2025-02-09_11-17-14.jpg (80.84 KiB) Viewed 566 times
free h .jpg
free h .jpg (84.54 KiB) Viewed 569 times
User avatar
Jasper
Posts: 1846
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 897 times
Been thanked: 385 times

Re: How Much of an Operating System is Loaded in Memory?

Post by Jasper »

@JusGellin

Read this and calculate the total size of all the files that are loaded (OS specific) into RAM initially.

viewtopic.php?t=10453&sid=9ae59809a1c75 ... 78cd0772da

Note the caveat that some files are not loaded into RAM until actioned.

User avatar
mikewalsh
Moderator
Posts: 6529
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 997 times
Been thanked: 2173 times

Re: How Much of an Operating System is Loaded in Memory?

Post by mikewalsh »

@JusGellin :-

Mm. Okayyy...

As far as I understand it - and even after 10+ years with Puppy, etc, I may STILL "have it wrong"; feel free to correct me at any time, guys! - standard operating systems, including most Linux distros, where everything is written in full to your primary storage medium, usually "pull" from the drive into RAM just those items that are actually needed for a given operation at the moment when they're wanted.

Puppy ( and this includes the other distros covered here on the forum) - all of which operate on the frugal principle - because they're quite small & 'compact' compared to nearly all other OSs, usually "pull" the entire operating system (which is compressed into a single, solid file) and de-compress it into a special, 'virtual' file-system which is temporarily set up in RAM on a per-session basis.

Don't forget, that just as Puppy has 'grown' in size over the years, so too has hardware evolved over the same time-frame. We're most of us using much more capable hardware than we were a decade ago; the ability to load the entire OS into RAM hasn't yet outstripped the hardware's ability to accommodate it.

Then, of course, you have your swap space - if you temporarily run out of RAM for whatever reason - which uses a part of your storage drive for memory (although this is a lot slower).....or you can create a special 'file' that does the same thing, and can be situated anywhere in your system. This is what Windows calls the "page-file"; it performs the exact same task. IF you have sufficient RAM to start with, you CAN configure Linux to never swap at all....what's called "zero swappiness".

Then there's 'memory caching', where frequently-used code is 'held' in RAM so as to avoid the need to read it in again & again....

===============================

That's pretty much where my knowledge runs out - apart from the well-known conundrum where new users think that Linux has somehow 'eaten' their RAM - because the command given above by @pp4mnklinux is telling them they have no 'free memory' left..! This is due to the previous item; Linux will use every bit of spare RAM it can find for 'memory caching' when it's not otherwise being used, because it helps everything to run more smoothly. But it will ALWAYS 'release' that RAM whenever the system or an application calls for it.

OSs are rather more complex beasts than most people realize OR understand them to be.....

Mike. ;)

dimkr
Posts: 2520
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 53 times
Been thanked: 1273 times

Re: How Much of an Operating System is Loaded in Memory?

Post by dimkr »

There are many ways to interpret this question, and many more ways to answer it. Regions in frequently accessed files (including SFSs) and recently modified files that were not yet flushed to disk will be included in "cache", "buffer cache" or "page cache", depending on the tool you use and the terminology it uses. vmtouch -v /path/to/sfs will show what parts of a SFS are cached in RAM - if it's only a small part of it, you can probably add pfix=nocopy with zero impact on performance.

Post Reply

Return to “Users Help”