Changed the maximum buffer size for double buffering of controls that isn't disposed after each draw call to the size of the screen. This should reduce the memory allocation and disposing on each sensor update. Also page faults are no longer increasing with this change.

This commit is contained in:
Michael Möller
2011-06-25 14:46:28 +00:00
parent f398a556c5
commit 0bb5d2d1e1
+6 -1
View File
@@ -99,6 +99,11 @@ namespace OpenHardwareMonitor.GUI {
this.unitManager = new UnitManager(settings);
// make sure the buffers used for double buffering are not disposed
// after each draw call
BufferedGraphicsManager.Current.MaximumBuffer =
Screen.PrimaryScreen.Bounds.Size;
// set the DockStyle here, to avoid conflicts with the MainMenu
this.splitContainer.Dock = DockStyle.Fill;
@@ -258,7 +263,7 @@ namespace OpenHardwareMonitor.GUI {
// Make sure the settings are saved when the user logs off
Microsoft.Win32.SystemEvents.SessionEnded += delegate {
SaveConfiguration();
};
};
}
private void InitializePlotForm() {