Quote:
Originally Posted by wakatana
swap is for "increasing capacity of RAM"
|
That may be too simplistic a view. Linux balances ram use with disk use in several different ways:
File or disk caching uses ram in situations where the requests are for disk.
File mapping allows Linux to dynamically page between ram and an underlying file, while letting the program act as if the entire content is in ram. That feature is heavily used for executable code, both main and shared images, but might also be used for data.
Swap space is used just for "anonymous" pages (those that have no defined connection to a disk file). In modern systems, those might be a small of the total memory use and an even smaller fraction of the memory actively paged from disk.
Quote:
ps aux did not show the real amount of used memory cause it calculate also shared libraries
|
"real amount of used memory" for a process is hard to even define and harder to measure and any value shown by tools such as ps will be wrong for more reasons than just the unknown amount of sharing for shared libraries.
Quote:
heard about virtual memory and paging but dont know what is it for.
|
"Virtual memory" can refer to any of several related features, all of which are based on a hardware mapping layer that translates every address a process uses from a virtual address to a physical address. Because of that translation:
Each process has its own address space, even though all run on the same computer.
The limit on the size of the virtual address space is disconnected from the actual amount of physical ram. On a 32 bit system, each process private virtual address space is limited to 3GB regardless of whether the amount of physical ram is far less or far more than 3GB.
Paging refers to any of several related features that are based on the fact that the above translation normally works in 4KB chunks called "pages" and the translation can be programmed for any subset of the pages such that on any access to those pages the process will be interrupted and the kernel can change the translation (including reading pages in from disk) before the process continues.
Quote:
Can you please advise me further (begginer-intermediate-expert level) reading (from administrator perspective not from kernel developer)
|
Sorry, I don't know any good documents for that perspective. Ram is inexpensive enough that most of the old strategies for dealing with insufficient ram are rarely of value any more. Usually the right answer is to buy enough ram for what you want to do. Knowing how much you need and/or dealing with not having enough, are so specific to what you are using the system for that there aren't general purpose answers.
Quote:
I posted to hardware cause I think It is thread closest to hardware than software.
|
Wrong. Hopefully a moderator will move your thread soon to a better forum.