مشاهده نسخه کامل : حا?ظه مجازی
شیماسادات
06-05-2007, 21:00
سلام می خواستم ببینم کسی در مورد " نقش حا?ظه مجازی بر نرم ا?زارها می دونه ؟
سلام
خوب آنچه که مسلم هست ، برنامه های داده ها و اطلاعات بسیاری زیادی دارند که همشون توی حا?ظه اصلی کامپیوتر جا نمیشه یا اگه جا بشه اینقدر مهم نیستند که بخواند همشون رو توی حا?ظه اصلی کامپیوتر قرار بدهند به همین خاطر سیستم عامل یک سازو کاری تدارک دیده برای برنامه ها که بخشی از هارد دیسک رو به عنوان حا?ظه مجازی به برنامه ها میده و زمانی که برنامه نیاز به داده های اون بخش پیدا می کنه اون رو به داخل حا?ظه اصلی ?راخوانی میکند
بحثش به اين شكل هست :
وقتي نرم ا?زاري براي دسترسي به يكي از ص?خات حا?ظه سيستم اقدام ميكنه و Page درد دسترس نباشه ( بعبارتي حا?ظه كاملا مصر? شده باشه ) يك Page Fault ايجاد ميشه . پس از اين سخت ا?زار مي آد كنترل را به سيستم عامل منتقل مي كنه تا سيستم عامل ?ضايي اضا?ي ( مجازي ) را كه در نظر گر?ته به سخت ا?زار معر?ي كنه .
بعد از معر?ي پردازنده مي آد آدرس شروع Page مجازي را بدست مي گيره و با ا?زودن Offset از ?ضاي مجازي است?اده مي كنه .
===========
در واقع اين پروسه بعنوان يك Task در كرنل سيستم عامل قرار گر?ته تا وقتي Page Fault ايجاد شد كنترل را بدست بگيره /
===========
اطلاعات بيشتر را مي توانيد اينجا مطالعه كنيد :
http://computer.howstuffworks.com/virtual-memory.htm
و يا خلاصه بحث از اينجا :
http://computer.howstuffworks.com/question684.htm
مطلب زير هم خيلي م?يد هست / بر گر?ته از سايت يكي از MVP هاي مايكروسا?ت :
What is Virtual Memory?
In a 32-bit computer, the memory addresses are 32 bits long and stored as binary (base 2) numbers. There are approximately 4 billion possible different 32-bit binary numbers (2^32=4,294,967,296). Because of this, there is a 4GB limit for addressable memory in a 32-bit computer.
A program instruction on an Intel 386 or later CPU can address up to 4GB of memory, using its full 32 bits. Each process is assigned an address space of 4GB of virtual memory, regardless of the amount of available physical memory. Each process is isolated from the rest and has its own 4GB address space. This means that the 4GB addressability limit applies on a per-application basis, not across all applications taken together.
This is normally far more than the RAM of the machine. The amount of physical memory on the computer is not related to the amount of memory address space. If a computer has 256MB of physical memory, there is still a 4GB memory address space, and if a computer has 8GB of physical memory, there is still a 4GB memory address space.
Applications are not allowed direct access to physical memory. When an application requests more memory, Windows maps some physical memory (as long as some is available) into the process's address space.
The hardware provides for programs to operate in terms of as much as they wish of this full 4GB space as Virtual Memory, those parts of the program and data which are currently active being loaded into Physical Random Access Memory (RAM). Windows maintains several tables that keep track of all of this, and the application knows only about the virtual memory address.
The processor itself then translates (‘maps’) the virtual addresses from an instruction into the correct physical equivalents, doing this on the fly as the instruction is executed. The processor manages the mapping in terms of pages of 4KB each - a size that has implications for managing virtual memory by the system.
Why do I need page file optimization?
Optimizing your page file when you're running low on RAM is always a good idea. When all physical RAM in a computer is in use, Windows starts using the hard disk as if it were additional RAM. This is why we have a Pagefile (also called the swap file). Because RAM memory is a lot more faster than the hard disk, whenever the computer begins to use the Pagefile to relieve memory pressure, we begin to experience a drastic performance degradation.
One of the most effective things you can do to improve performance is ensure that there is enough RAM available to avoid frequent paging (swapping) of memory contents between disk and RAM.
This means that the actual limit on the memory used by all applications is the amount of RAM installed plus the maximum size of the Pagefile.
How much swap space do you need? That depends the amount of RAM you have and the programs you use. The rule of the thumb is 1.5 times the amount of system memory, unless you have too much load on your system.
vBulletin v3.7.1, Copyright © 2000-2006, Jelsoft Enterprises Ltd.