Question:
what is called main memory and virtual memory in computers?
cmts_shivakumar
2007-07-30 10:17:02 UTC
tell me something about paging and swapping also
in connection with main memory and virtual memory
Eight answers:
2007-07-30 10:20:59 UTC
virtual memory is, i think memory stored in RAM

and so, main memory is hard disk

im not sure
cool_chunks
2007-07-30 10:39:36 UTC
All this is related to Memory Management.



Main memory



Main memory of the computer is the Primary Memory or we can say the RAM of a computer. All the programs which, are to be executed are first loaded in this primary memory and then allocated the CPU for processing. The Main memory stores the Operating system, and all the programs which are under execution.



Virtual Memory



Virtual memory is a concept which was realised to run partially loaded programs on the computer. with partially loaded we mean, that some programs like multimedia files (while playing movies) are very big that they can not be accomodated in the RAM all at once, hence a space on the secondary memory i.e. the hard disk is used and it is divided into frames. Similarly, the primary memory is divided into pages of size equal to that of frames. Now these frames are repeatedly placed in the main memory as pages.



Paging



Paging is the technique of implementing virtual memory. Whenever a page is requested by the CPU, it is said to be Demand Paging. The page is looked for in the main memory if not found a page fault occurs, and the page is brought from the secondary storage. Various page replacemtn techniques are used when the memory is filled and new pages are required. these techniques see to that which page is to be replace.

Swapping is removing one page from main memory (swap out) and getting page from secondary memory to main memory is termed as swap in.



For further detail you can refer the following books:



Operating System Galvin

Operating System Andrew S. Tannebaum

Computer Architecture John D. Carpinelli



Good Luck!
2007-08-01 23:41:51 UTC
Main memory:

Memory that can be read from or written to by a computer or other devices.



Virtual memory:

Temporary storage used by a computer to run programs that need more memory than it has. For example, programs could have access to 3-4GB of virtual memory on a computer's hard drive, even if the computer has only 32 megabytes of RAM.



Paging:

A hidden file on the hard disk that Windows uses to hold parts of programs and data files that do not fit in memory. The paging file and physical memory, or RAM, comprise virtual memory. Windows moves data from the paging file to memory as needed and moves data from memory to the paging file to make room for new data.



Paging file is also called a swap file.
?
2016-04-01 04:07:27 UTC
RAM: Random Access Memory is a form of memory that can be read without having to begin at the first address, then the second address, then the third, and so on. This is a carryover from when most memory was Serial Access, such as magnetic tape, paper tape, or punched cards. The on-board memory computers use for temporary storage is Random Access Memory, but on chips, instead of a hard disc drive. ROM: Read Only Memory is exactly what the name implies, it can only be read, not written to. A CD-ROM is a form of memory, as is a chip on the motherboard which is used to store instructions for the Central Processor Unit. RAM is your computer's temporary storage space. RAM is really the computer's short-term memory. As such, it remembers everything that the computer needs to process the data into information, such as data that has been entered and software instructions, but only when the computer is on. This means that RAM is an example of volatile storage. When the power is off, the data stored in RAM is cleared out. This is why, in addition to RAM, systems always include nonvolatile storage devices for permanent storage of instructions and data when the computer is powered off. Hard disks provide the greatest nonvolatile storage capacity in the computer system.
526F686974
2007-07-30 10:54:11 UTC
The main memory is the physical memory of your computer i.e., RAM & ROM

RAM as you will be knowing, stores all kind of data for temporary purposes.



It is not possible to store -ALL- the data onto the RAM when you are doing some "heavy-duty" work like gaming / designing. So whenever the system runs out of RAM, the rest of that data is stored or "paged" onto the hard drive as "pagefiles" or "swapfiles" hence allowing you to do more work efficiently.



Virtual memory is the temporary memory that is "paged" or written onto the disk for future or current use. Almost all OS s do that today.



But if you have +1 GB of RAM, then paging is not necessary.



But please note that we use RAM because its faster than the Hard drive but if you've run out of RAM, what else can you do other than paging or upgrading?



P.S : Swapping is same as paging
2007-07-31 03:41:00 UTC
Main Memory - The RAM

Virtual Memory - A logical RAM on your HDD



Why Virtual Memory - coz it's Cheaper .. Remember you have 512 MB of RAM and 500 GB of HDD and GB > MB.. Now you get it..!!



Paging - A way of handling Virtual Memory, Breaking Virtual Memory into pages and Loading it as and when required, also called OnDemand Paging



Swapping is similar to simple swapping of places, no# and wives (ajnabee :D) In Context to Memory swapping of pages



Example: You have a Program of 4 MB, But page size is of 1 MB that means A Single PAGE can hold only 1 MB of data. What happens is 4 Pages are made each of 1 MB and they are loaded into Virtual Memory one-by-one.



Read more about it here..

http://en.wikipedia.org/wiki/Virtual_Memory





********************************************

If you like the answer..Please VOTE ;)
2007-07-30 10:23:59 UTC
Virtual memory is an addressing scheme implemented in hardware and software that allows non-contiguous memory to be addressed as if it were contiguous. The technique used by all current implementations provides two major capabilities to the system:



Memory can be addressed that does not currently reside in main memory and the hardware and operating system will load the required memory from auxiliary storage automatically, without any knowledge of the program addressing the memory, thus allowing a program to reference more (RAM) memory than actually exists in the computer.

In multi tasking systems, total memory isolation, otherwise referred to as a discrete address space, can be provided to every task except the lowest level operating system. This greatly increases reliability by isolating program problems within a specific task and allowing unrelated tasks to continue to process.







Paging

If a program references a memory location that resolves within a virtual page not available, the computer will generate a page fault. The hardware will pass control to the operating system at a place that can load the required page from auxiliary storage (e.g., a paging file on disk) and turn on the flag to say the page is available. The hardware will then take the start location of the page, add in the offset of the low order bits in the address register and access the memory location desired.



All the work required to access the correct memory address is invisible to the application addressing the memory. If the page is in memory, the hardware resolves the address. If a page fault is generated, software in the operating system resolves the problem and passes control back to the application trying to access the memory location. This scheme is called paging.





Swapping in the Linux and BSD operating systems

In the Linux and BSD operating systems, it is common to use a whole partition of a hard disk for swapping. Though it is still possible to use a swap file instead, it is recommended to use a separate partition because this excludes chances of file system fragmentation which would reduce performance. Also, by using a separate swap partition, it can be guaranteed that the swap region is located at the fastest location of the disk which is generally the center cylinders between the inner and outer edges of the disk (except for disks with fixed heads). However with the 2.6 Linux kernel, swap files are just as fast[1] as swap partitions. As such, this recommendation doesn't apply much to current Linux systems and the flexibility of swap files can outweigh those of partitions, and since modern high capacity hard drives can remap physical sectors, there is no guarantee that a partition will be contiguous, and even if it were, having the swap data near the rest of the data will reduce seek times when swapping was needed, so the aforementioned performance claims probably do not apply to modern Linux systems.[citation needed]



Linux supports using a virtually unlimited number of swapping devices, each of which can be assigned a priority. When the operating system needs to swap pages out of physical memory, it uses the highest priority device with free space. If multiple devices are assigned the same priority, they are used in a fashion similar to level 0 RAID arrangements. This gives increased performance as long as the devices can be accessed efficiently in parallel - therefore, care should be taken assigning the priorities. For example, swaps located on the same physical disk shouldn't be used in parallel, but in order ranging from the fastest to the slowest (i.e.: the fastest having the highest priority).



There are also some successful attempts[2] to use the memory located on the graphics card for swapping on Linux, as modern graphics cards often have 128 or even 256 megabytes of RAM which normally only gets put to use when playing games. Video memory being significantly faster than HDDs, this method gives excellent swapping performance.



Recently, some experimental improvements to the 2.6 Linux kernel have been made by Con Kolivas, published in his popular CK patchset[3]. The improvements, called "Swap Prefetch", employ a mechanism of pre-fetching previously swapped pages back to physical memory even before they are actually needed, as long as the system is relatively idle (so not to impair performance) and there is available physical memory to use. This gives several orders of magnitude faster access to the affected pages when their owning process needs access to them, since they are effectively not swapped out by then.[citation needed]



Main memory

The main memory of the computer is also known as RAM, standing for Random Access Memory. It is constructed from integrated circuits and needs to have electrical power in order to maintain its information. When power is lost, the information is lost too! It can be directly accessed by the CPU. The access time to read or write any particular byte are independent of whereabouts in the memory that byte is, and currently is approximately 50 nanoseconds (a thousand millionth of a second). This is broadly comparable with the speed at which the CPU will need to access data. Main memory is expensive compared to external memory so it has limited capacity. The capacity available for a given price is increasing all the time. For example many home Personal Computers now have a capacity of 16 megabytes (million bytes), while 64 megabytes is commonplace on commercial workstations. The CPU will normally transfer data to and from the main memory in groups of two, four or eight bytes, even if the operation it is undertaking only requires a single byte.



is there anythin else u wanna know dear??
A.G.Pillai
2007-07-30 10:26:52 UTC
GOOD QUESTION AND IF I ANSWER IT WILL BE A BAD ANSWER I AM SORRY


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...