LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-31-2009, 04:12 AM   #1
wakatana
Member
 
Registered: Jul 2009
Location: Slovakia
Posts: 141

Rep: Reputation: 16
process, memory, swap, virtual memory


Hi all I would like to know more about how linux thread with processes, ram, swap and virtual memory.
The only think I know so far are:
that swap is for "increasing capacity of RAM", ps aux did not show the real amount of used memory cause it calculate also shared libraries, that further information can be found ind /proc, also heard that linux uses monolitic kernel and heard about virtual memory and paging but dont know what is it for.
Can you please advise me further (begginer-intermediate-expert level) reading (from administrator perspective not from kernel developer) Thanks a lot
PS: I posted to hardware cause I think It is thread closest to hardware than software.

Last edited by wakatana; 08-31-2009 at 04:42 AM.
 
Old 08-31-2009, 07:55 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by wakatana View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 04:05 AM
Swap Memory / Virtual Memory in Fedora Core 6 Jojo_CFT Linux - Newbie 2 10-15-2007 04:23 AM
Help Configuring the Memory Used by a Process in RedHat? (Cache Memory on CPU) geogecko Linux - General 3 02-23-2005 03:32 PM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 12:50 PM
virtual memory (swap) starquake Linux - Newbie 7 03-27-2003 07:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration