开发者

How do I calculate how many pages of memory I need?

开发者 https://www.devze.com 2023-01-29 21:56 出处:网络
I have a 32-bit system. 2^32 bytes of memory. Let\'s say 4KB per page: 2^12 pages. How does one determine the required number of pag开发者_运维技巧es? 2^32 / 2^12 = 2^20? So we have 20 bits for pagin

I have a 32-bit system. 2^32 bytes of memory. Let's say 4KB per page: 2^12 pages.

How does one determine the required number of pag开发者_运维技巧es? 2^32 / 2^12 = 2^20? So we have 20 bits for paging and 12 bits for offset?

Anyone have an example of how I could understand paging?


Your calculation is correct for a simple paging system, but things get more complicated for systems which allow variable sized pages (i.e. Pentium). Just be wary of the difference between virtual addressing and physical addressing... although your architecture might allow for 2^32 addressable bytes of memory, your actual hardware may have less or more memory.

If you want an example, just look up some university notes on operating systems... there are some lecs on memory management here.


We can Set page memory as 1.5 % multiple of our totaal available physical memory ie if we have 4 gb of RAM then page file size can be upto 6 gb

0

精彩评论

暂无评论...
验证码 换一张
取 消