A través de mi colección accidente automatizado para MaxTo me dieron el siguiente informe de bloqueo:Win32Exception No hay suficiente almacenamiento está disponible para procesar este comando
V8.12.0.0 - System.ComponentModel.Win32Exception - :Void UpdateLayered():0
Version: MaxTo8.12.0.0
Exception: System.ComponentModel.Win32Exception
Error message: Not enough storage is available to process this command
Stack trace:
at System.Windows.Forms.Form.UpdateLayered()
at System.Windows.Forms.Form.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmCreate(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at MaxTo.MainForm.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Otra StackTrace:
Version: MaxTo2009.9.0.0
Exception: System.ComponentModel.Win32Exception
Error message: Not enough storage is available to process this command
Stack trace:
at System.Windows.Forms.Form.UpdateLayered()
at System.Windows.Forms.Form.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmCreate(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
En esta última traza de la pila que hay no es ninguna referencia a MaxTo en absoluto, y el 90% de los bloqueos que obtengo tienen rastros de pila similares a los de arriba.
Leyendo en la red Creo que este error es habitual si olvida liberar o eliminar variables. Al mirar a través de WndProc
, que parece que algunas veces pasa el problema, no puedo encontrar un solo lugar que cuelgue de referencias a cualquier objeto. Todas menos una de las variables son locales para WndProc y, por lo tanto, deberían ser basura cuando el método finaliza.
protected override void WndProc(ref Message m)
{
base.WndProc(ref m); // I'm assuming the first trace can be caught here
IntPtr hwnd = m.WParam;
// Our hook tells us something got maximized
if (Win32Import.UWM_MAXIMIZE == (UInt32)m.Msg)
{
// Figure out if we are temporarily disabled or using alternative profiles
KeyStateInfo keyState = KeyboardInfo.GetKeyState(Settings.AlternativeProfileKey);
Rectangle r = FindRectangle(MousePosition, (Settings.EnableAlternativeProfile && keyState.IsPressed ? AlternativeRegions : Regions));
// Did we find a rectangle to place it in?
if (r != Rectangle.Empty)
{
Rectangle position = Win32Import.GetWindowRectangle(hwnd);
Rectangle previousPos = GetLocation(hwnd);
if (position == r && previousPos != Rectangle.Empty)
{
// We are restoring the original position
Win32Import.SetWindowPos(hwnd, IntPtr.Zero, previousPos.X, previousPos.Y, previousPos.Width, previousPos.Height, Win32Import.SWP_NOZORDER | Win32Import.SWP_NOSENDCHANGING);
}
else
{
// We are maximizing to a region
Win32Import.ShowWindow(hwnd, Win32Import.WindowShowStyle.Restore);
Win32Import.SetWindowPos(hwnd, IntPtr.Zero, r.X, r.Y, r.Width, r.Height, Win32Import.SWP_NOZORDER | Win32Import.SWP_NOSENDCHANGING);
// Make sure we remember this location
RememberLocation(hwnd, position);
}
}
}
else if (MaxTo64WindowHandleMessage == m.Msg)
{
// Store the window handle of our 64-bit subprocess
SubProcess64WindowHandle = m.WParam;
}
}
No he podido reproducir el error, incluso mientras se ejecuta el programa durante varios días.
Mi suposición es que el sistema tiene poca memoria no fragmentada o identificadores GDI, pero no puedo confirmarlo en ninguna parte. No parece haber ninguna buena documentación sobre este error.
¿Alguna idea de qué más podría ser? ¿Puedo hacer algo para evitar este error?
actualización: La pregunta se volvió a abrir con más trazas de pila, debido a la falta de una solución decente. Simplemente ignorarlo no resuelve el problema.
No está relacionado con la pregunta, pero ¿cómo se recopilan los informes de fallos? – Giorgi
Utilizando Fogbugz BugzScout (Google it) y un controlador de error global escrito a medida en el programa. No es muy difícil. –
¿Hay algo informado en el registro de eventos de la aplicación Windows en el momento del error? –