473,695 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Control. DoubleBuffer = true causes a lot soft page faults

Related to my other post on Graphics.FillRe ctangle and a lot of page
faults caused by this call...

We determine that when Control.DoubleB uffer=true to avoid the flicker
effect, Graphics.FillRe ctangle causes a lot of soft page faults - order
of 700/sec and more... When Control.DoubleB uffer=false, we have no page
faults at all - 0/sec.

Has anyone seen this behavior and how did they resolve it...? What are
our options...? Does "OptimizedDoubl eBuffer" do anything in .NET
2.0...?

Also - soft page faults are not an issue in a general sense, but if
they average around 1500/sec like they do for our app and they never
even get close to zero at all during the whole test, and they also
relate to one method Graphics.FillRe ctangle and
Control.DoubleB uffer=true, then this is definitely something to get
concerned about. From the tool we used to monitor the page faults done
by Graphics.FillRe ctangle, it appears it page faults every time the
method is invoked - through our Control.Render calls with
Control.DoubleB uffer=true.

thx

Nov 17 '05 #1
4 3792
Not to be blunt, but you aren't exactly indicating that this is
impacting your performance in a bad way. You just have this statement that
you have a good number of soft page faults, and imply that it is a problem,
which you need to fix.

Is the application not performing correctly, or not performant as a
result?

It's not that I think you are wrong, but there are a good number of
people who post to the groups with questions regarding high numbers in
certain things (page faults, memory usage in task manager) and associate
that with something wrong with the program. This isn't always the case.
I'll admit that yes, you should understand what is going on in your program
(to what degree is debatable), but at the same time, if you don't have any
negative effects, or even postulate what negative effects you might have as
a result of what you are observing, then I question the reasons for wanting
to address the issue.

Can you clarify what you think might happen, or is happening as a
result?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
<tb*********@ho tmail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Related to my other post on Graphics.FillRe ctangle and a lot of page
faults caused by this call...

We determine that when Control.DoubleB uffer=true to avoid the flicker
effect, Graphics.FillRe ctangle causes a lot of soft page faults - order
of 700/sec and more... When Control.DoubleB uffer=false, we have no page
faults at all - 0/sec.

Has anyone seen this behavior and how did they resolve it...? What are
our options...? Does "OptimizedDoubl eBuffer" do anything in .NET
2.0...?

Also - soft page faults are not an issue in a general sense, but if
they average around 1500/sec like they do for our app and they never
even get close to zero at all during the whole test, and they also
relate to one method Graphics.FillRe ctangle and
Control.DoubleB uffer=true, then this is definitely something to get
concerned about. From the tool we used to monitor the page faults done
by Graphics.FillRe ctangle, it appears it page faults every time the
method is invoked - through our Control.Render calls with
Control.DoubleB uffer=true.

thx

Nov 17 '05 #2

<tb*********@ho tmail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Related to my other post on Graphics.FillRe ctangle and a lot of page
faults caused by this call...

We determine that when Control.DoubleB uffer=true to avoid the flicker
effect, Graphics.FillRe ctangle causes a lot of soft page faults - order
of 700/sec and more... When Control.DoubleB uffer=false, we have no page
faults at all - 0/sec.

Has anyone seen this behavior and how did they resolve it...? What are
our options...? Does "OptimizedDoubl eBuffer" do anything in .NET
2.0...?

Also - soft page faults are not an issue in a general sense, but if
they average around 1500/sec like they do for our app and they never
even get close to zero at all during the whole test, and they also
relate to one method Graphics.FillRe ctangle and
Control.DoubleB uffer=true, then this is definitely something to get
concerned about. From the tool we used to monitor the page faults done
by Graphics.FillRe ctangle, it appears it page faults every time the
method is invoked - through our Control.Render calls with
Control.DoubleB uffer=true.

thx


A "Soft" page fault occurs each time there is transition between the
"transition " lists (like the standby page list, modified page list, Free
page list etc...) and the process(es) working set. A process that
reserves/commits a large number of pages will incur a lot of soft page
faults. A graphics application (I would never use .NET to author one) might
consume a lot of memory when large pictures are brought in into the WS,
especially when double buffering is used.
So, if you really want to reduce the Soft faults (but I don't see any
reason, unless they escalate to hard faults), you'll have to consume less
memory, that means you'll have to turn off double buffering or reduce the
picture size.
Willy.


Nov 17 '05 #3
Avg of 1500 page faults/sec for a control with DoubleBuffering =true is
a lot to everyone even if they are soft PFs -- page =4Kb - so we can do
the math so to speak how much we are soft page faulting ... When
doublebuffer=fa lse, the page faults are down to 0/sec. Since we all
agree soft page faults are not a bad thing - I agree they are not, but
only in lower numbers than what we are getting - we are consistently
above 1000/sec and never even come up to 0 when doublebuffer=tu e. I
would view any app in Task Manager- PF Delta and I would challenge to
come up with the numbers we are having. Every time we need to render a
control with this setting on, and when a soft page faults occurs, means
less time requests are spent on the processor executing, as memory is
being searched for in order for the request to be sent to the
processor. With the number of SPFs we have, that to me can add up, and
although in ms's, I would hate to drop this issue just on the account
of SPFs not being such a bad thing. Although users do not see any
performance difference (you are correct), this is a concern and needs
to be addressed. We figured out that a call to .FillRectangle with
double buffering on causes 160 soft page faults/sec --every time--
..FillRectangle is executed - so it page faults every time. This either
sounds like an inefficient code to me or smth we are not being told.

Don't know about everyone - but if you know of workarounds or anything
else to point us how to fix the problem - I would love to hear it. I
don't think that argument soft page faults are not bad would work in
this case as that is hardlu something I can use to explain this
behavior. BTW, we are logging a bug to Microsoft to hear their opinion
as well.

Nov 17 '05 #4

<tb*********@ho tmail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Avg of 1500 page faults/sec for a control with DoubleBuffering =true is
a lot to everyone even if they are soft PFs -- page =4Kb - so we can do
the math so to speak how much we are soft page faulting ... When
doublebuffer=fa lse, the page faults are down to 0/sec. Since we all
agree soft page faults are not a bad thing - I agree they are not, but
only in lower numbers than what we are getting - we are consistently
above 1000/sec and never even come up to 0 when doublebuffer=tu e. I
would view any app in Task Manager- PF Delta and I would challenge to
come up with the numbers we are having. Every time we need to render a
control with this setting on, and when a soft page faults occurs, means
less time requests are spent on the processor executing, as memory is
being searched for in order for the request to be sent to the
processor. With the number of SPFs we have, that to me can add up, and
although in ms's, I would hate to drop this issue just on the account
of SPFs not being such a bad thing. Although users do not see any
performance difference (you are correct), this is a concern and needs
to be addressed. We figured out that a call to .FillRectangle with
double buffering on causes 160 soft page faults/sec --every time--
.FillRectangle is executed - so it page faults every time. This either
sounds like an inefficient code to me or smth we are not being told.

Don't know about everyone - but if you know of workarounds or anything
else to point us how to fix the problem - I would love to hear it. I
don't think that argument soft page faults are not bad would work in
this case as that is hardlu something I can use to explain this
behavior. BTW, we are logging a bug to Microsoft to hear their opinion
as well.

Please post your code or at least a repro that illustrates the issue, the
point is that I can't see how you know that FillRectangle is causing PF's,
each FillRectangle is followed by a Redraw I guess (which is causing PF's,
just minimize/maximize Explorer for instance and watch the PF's delta)).
Note also that, as I said before, that the number of PF's depend on the
number and the size of the input images (bitmap or whatever) not the size of
the drawing rectangle.
Willy.
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2876
by: Sasha Shevelev | last post by:
Hi there, I can;t believe no one else has had this prob but here goes... I add some javascript into my page and asp.net sometimes (not always) puts the js into my page with a line break rendering it useless... Here is my code...
2
4306
by: JH | last post by:
I am attempting to enable double buffering for a panel control. The SetStyle method of the panel control is protected, so I am attempting to access it by writing a special panel class that inherits from System.Windows.Forms.Panel. But from there I am not sure how to access the protected member SetStyle to set DoubleBuffer to true. Can anyone point me in the right direction? Some code example would be extremely helpful to me.
11
6186
by: Sagaert Johan | last post by:
I have made a custom control that draws a rectangle when the mouse is down, and does nothing when the mouse is up. I set/reset a flag in MouseDown/Mouse up and use this to do the drawing in the OnPaint . The recangle draws correct when i press the mouse, but when i release the mouse the background is not restored What should i do in the Onpaint to make sure the background (the form) is restored correctly ? This problem already keeps...
0
1923
by: Chris Millar | last post by:
I have a user control that i wish to extend to change the date when the user selects the numeric up down button. The code explains itself, hope someone can help. any ideas appreaciated.. Chris. code :
3
8041
by: 八大山人 | last post by:
HI, I create a custom transparent control, set the style is ControlStyles.DoubleBuffer, It display black background. How to create a double buffer transparent control?
1
1305
by: 八大山人 | last post by:
HI, I create a custom transparent control, set the style is ControlStyles.DoubleBuffer, It display black background. How to create a double buffer transparent control? The ralative code is: // in constructor base.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.StandardClick | ControlStyles.Opaque, true);
0
2097
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display some stuff in the main display area. The stuff to display is one of many assemblies loaded at the opening of the application by Activator.CreateInstance, because I want it independant of the main application, as a plugin. All assembly are loaded...
2
2098
by: sasifiqbal | last post by:
Hi, One of my developers are facing an interesting problem regarding UserControl invalidation. The problem is: We have two forms in our application. Form A does nothing except loading of Form B and Form B contains an array of UserButton kind of contol (we have created our own buttons deriving from UserButton). All the drawings activities in Form B are okay and nothing gets wrong if we
0
1676
by: Andy Wynn | last post by:
I have a custom control that has a rectangle drawn at the bottom of the control. Nothing fancy, just a rectangle with a color fill. The control has the ability to be resized ( Collapsed - Expanded). Each time the control is resized, the rectangle needs to be redrawn in its proper location. The probem is that the resize event fires and finishes before the Paint event can redraw the rectangle, giving me a very nasty flicker. I have...
0
9112
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8824
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5831
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4336
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4571
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2994
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2258
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.