LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-06-2006, 01:56 PM   #1
Kropotkin
Member
 
Registered: Oct 2004
Location: /usr/home
Distribution: Mint, Ubuntu server, FreeBSD, Android
Posts: 362

Rep: Reputation: 32
General query: diff bw virtual vs. resident memory


In terms of the memory usage of a given application, what is the difference between virtual and resident memory? What matters most when you are trying to figure out what is using how much?

For example, at the moment, according to top, I see that Firefox is using approx 70Mb res, 137Mb virt. Which is more important?

Last edited by Kropotkin; 02-06-2006 at 01:58 PM.
 
Old 02-06-2006, 02:04 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
All in top man page:
Quote:
RES -- Resident size (kb)
The non-swapped physical memory a task has used.
RES = CODE + DATA.

VIRT -- Virtual Image (kb)
The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out.
VIRT = SWAP + RES.
 
Old 02-06-2006, 02:08 PM   #3
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Rep: Reputation: 15
man pages r bliss !!
 
Old 02-06-2006, 06:52 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Application programs live in a virtual-memory environment. All the memory they ever reference is virtual, in terms of virtual addresses.

Unbeknownst to the programs, all of their virtual memory is divided by the operating system into pages. Those pages can be non-existent (never referenced), a copy of a shared library page, a page that is in real-memory right now, or a page that's been copied to the swap-file, or some combination of the above.

Applications have no idea that any of this is going on.

The Linux memory-manager tries to utilize the real-memory (SIMMs on the motherboard) as efficiently as possible, balancing all the requirements of all the processes on an ongoing basis as their requirements constantly change.

There is no hard-and-fast rule. What you do want to avoid is "thrashing," or excessive swapping. You'll know it when you see it. It ain't pretty.
 
  


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
memory types - what's what: vm resident shared rss X's jonaskoelker Linux - Software 2 05-26-2005 04:59 AM
diff bet RAM & CACHE memory LinuxTiro Linux - Hardware 1 08-30-2003 12:23 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
memory (ram) query bigjohn Linux - Newbie 4 02-21-2003 02:36 AM
memory query bigjohn Linux - Newbie 1 11-14-2002 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:56 PM.

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