Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

DRAWIMAGE() -> TONS OF PAGE FAULTS!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
svd - 11 Aug 2005 02:10 GMT
Originally, I thought this was due to DoubleBuffer, but ran some further
experiments and discovered that page faults occur when calling DrawImage().
For example, create 2 images about 800x800, then call DrawImage to copy from
to the other (on say a mouse click). Notice about 600+ page faults occur
each time (the larger the area, the greater the number of page faults).

I have an application that calls DrawImage() once a second to update the
main screen, so after a few days, the page fault count is monsterous. I
swear this bogs down my system too.

Anyone else have this problem? Any solutions? Can someone report this as a
DEFECT.

Thanks,

Steve
Bob Powell [MVP] - 11 Aug 2005 10:06 GMT
You seem to have this idea that a page-fault is some kind of an error. It
isn't. It is simply the processor's way of keeping track of it's virtual
memory and signalling to the memory manager that it needs to swop a portion
of the page file.

If you have a small amount of RAM in the machine or if the system has a
large amount of programs and data loaded the paging requirements will be
high.

To cure the "problem" buy more RAM, optimise your swop-file perhaps by
making a big one and placing it on a separate, dedicated partition on a
disk. If your application has high memory requirements perhaps you will need
to specify a higher spec machine in the minimum requirements for your
product.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Originally, I thought this was due to DoubleBuffer, but ran some further
> experiments and discovered that page faults occur when calling
[quoted text clipped - 14 lines]
>
> Steve
Frank Hileman - 11 Aug 2005 14:47 GMT
These are probably soft page faults, not hard ones. Soft faults do not
require disk access:
http://blogs.msdn.com/greggm/archive/2004/01/21/61237.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvc60/html/opt
code.asp


Pages read/sec should show you hard page faults in the performance monitor
(don't use the task manager for these things).

I imagine it is simply large images.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

> You seem to have this idea that a page-fault is some kind of an error. It
> isn't. It is simply the processor's way of keeping track of it's virtual
[quoted text clipped - 30 lines]
>>
>> Steve
svd - 12 Aug 2005 15:39 GMT
Well, I have 512MB of ram and it never seems to grow to more than about 30%
of what I have available, even when the page faults are occurring.

Maybe page faults are not a bad thing, if not, why do they even bother
showing them in the task manager?

Steve

> You seem to have this idea that a page-fault is some kind of an error. It
> isn't. It is simply the processor's way of keeping track of it's virtual
[quoted text clipped - 29 lines]
> >
> > Steve

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.