Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

jonr

Pagefaults

This topic is 5342 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just ran a profiler on a small game engine i am working on an i noticed it gets around 500-700 pagefaults per second. This seems kinda high to me and i was wondering if anyone knows common things that cause this and how to prevent pagefaulting. Jon

Share this post


Link to post
Share on other sites
Advertisement
so basically its just windows reordering my stuff that causes this eh?

Share this post


Link to post
Share on other sites
Anyone tried using something like this? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/virtuallock.asp

sounds like it can lock your memory so you dont get pagefaulting....

Share this post


Link to post
Share on other sites
I noticed this too - you can get the windows task manager to show page faults. Winamps was flying up, and a lot of apps were going up pretty steadily.

Is a page fault just a miss of cached memory?

Share this post


Link to post
Share on other sites
High level of page faults are usually indicative of poor temporal and spatial locality of memory access. Reducing page faults can be done by reducing your process''s working set within a given time frame. There are a multitude of different ways to do that. Off the top of my head: use custom allocators to group temporally local objects in spatially local memory address, change data structures to favor fewer total allocations, taking advantage of multiple heaps if your compiler supports them, pre-processing batched data fetchs to so that they occur in a spatial local manner, and of course, the just-use-less-memory technique.

Share this post


Link to post
Share on other sites
quote:
Original post by jonr
Anyone tried using something like this? ...snip...
sounds like it can lock your memory so you dont get pagefaulting....


I find that in most cases VirtualLock() will actually hurt application performance. The OS tends to be a better judge of what needs to be paged out than the programmer.

Share this post


Link to post
Share on other sites
quote:
Original post by Evil Steve
Is a page fault just a miss of cached memory?


A page fault is when memory requested is not in the physical memory, so the virtual memory manager needs to fetch the requested information from the disk and place in physical memory.

When the memory requested is not the cache, it''s simply called a cache miss.

Share this post


Link to post
Share on other sites
I''m still sticking to what I said, use less memory.

find ways to do that, and the page faulting will disappear.

suggestions:
-optimize for size, not speed
-try to avoid referencing various large piles of data in tight loops, just try to stick to a minimal set.
-reduce quality of lossy things, like textures

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!