D
Dale Atkin
I'm coding in VB.net
I've been periodically getting an 'odd' error message that I don't
understand. Normally I can 'pseudo' fix the problem by doing something that
seems entirely unrelated to the problem, but the error keeps popping up
periodically.
Its an out of memory exception, and it pops up here and there. It keeps
complaining that there are 'too many items in list box' or 'too many items
in combo box', etc. The error *sounds* straight forward enough,
unfortunately, I have <<100 items in the list box/combo box in question.
Not sure if it makes a difference, or if it was a bad idea to begin with,
but I've been populating the list with custom objects (not strings). They
aren't all that big objects. Not sure the actual exact size of them, but the
XML file that is generated by the largest is 7kB.
Is this making any sense to anyone? Ringing any bells? (the exception detail
follows)
Dale
System.OutOfMemoryException was unhandled
Message="List box contains too many items."
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.ListBox.NativeAdd(Object item) at
System.Windows.Forms.ListBox.OnHandleCreated(EventArgs e) at
System.Windows.Forms.Control.WmCreate(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ListBox.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.DebuggableCallback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle,
String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y,
Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef
hInst, Object pvParam) at
System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle,
String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y,
Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef
hInst, Object pvParam) at
System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) at
System.Windows.Forms.Control.CreateHandle() at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl() at
System.Windows.Forms.Control.WmShowWindow(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.WmShowWindow(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.DebuggableCallback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle,
String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y,
Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef
hInst, Object pvParam) at
System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle,
String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y,
Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef
hInst, Object pvParam) at
System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) at
System.Windows.Forms.Control.CreateHandle() at
System.Windows.Forms.Form.CreateHandle() at
System.Windows.Forms.Control.get_Handle() at
System.Windows.Forms.Form.SetVisibleCore(Boolean value) at
System.Windows.Forms.Control.Show() at
AnatomyAlive.frmMain.frmMain_Load(Object sender, EventArgs e) in
E:\Users\UCVM Student\Documents\Visual Studio
2008\Projects\AnatomyAlive\AnatomyAlive\MDIParent1.vb:line 74 at
System.EventHandler.Invoke(Object sender, EventArgs e) at
System.Windows.Forms.Form.OnLoad(EventArgs e) at
System.Windows.Forms.Form.OnCreateControl() at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl() at
System.Windows.Forms.Control.WmShowWindow(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.WmShowWindow(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.DebuggableCallback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32
msg, Int32 wParam, Int32 lParam) at
System.Windows.Forms.Form.SetVisibleCore(Boolean value) at
System.Windows.Forms.Control.set_Visible(Boolean value) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationContext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine) at AnatomyAlive.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at
System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at
System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel) at
System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() at
System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext
activationContext, String[] activationCustomData) at
System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext
activationContext) at System.Activator.CreateInstance(ActivationContext
activationContext) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:
I've been periodically getting an 'odd' error message that I don't
understand. Normally I can 'pseudo' fix the problem by doing something that
seems entirely unrelated to the problem, but the error keeps popping up
periodically.
Its an out of memory exception, and it pops up here and there. It keeps
complaining that there are 'too many items in list box' or 'too many items
in combo box', etc. The error *sounds* straight forward enough,
unfortunately, I have <<100 items in the list box/combo box in question.
Not sure if it makes a difference, or if it was a bad idea to begin with,
but I've been populating the list with custom objects (not strings). They
aren't all that big objects. Not sure the actual exact size of them, but the
XML file that is generated by the largest is 7kB.
Is this making any sense to anyone? Ringing any bells? (the exception detail
follows)
Dale
System.OutOfMemoryException was unhandled
Message="List box contains too many items."
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.ListBox.NativeAdd(Object item) at
System.Windows.Forms.ListBox.OnHandleCreated(EventArgs e) at
System.Windows.Forms.Control.WmCreate(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ListBox.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.DebuggableCallback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle,
String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y,
Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef
hInst, Object pvParam) at
System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle,
String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y,
Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef
hInst, Object pvParam) at
System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) at
System.Windows.Forms.Control.CreateHandle() at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl() at
System.Windows.Forms.Control.WmShowWindow(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.WmShowWindow(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.DebuggableCallback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle,
String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y,
Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef
hInst, Object pvParam) at
System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle,
String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y,
Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef
hInst, Object pvParam) at
System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) at
System.Windows.Forms.Control.CreateHandle() at
System.Windows.Forms.Form.CreateHandle() at
System.Windows.Forms.Control.get_Handle() at
System.Windows.Forms.Form.SetVisibleCore(Boolean value) at
System.Windows.Forms.Control.Show() at
AnatomyAlive.frmMain.frmMain_Load(Object sender, EventArgs e) in
E:\Users\UCVM Student\Documents\Visual Studio
2008\Projects\AnatomyAlive\AnatomyAlive\MDIParent1.vb:line 74 at
System.EventHandler.Invoke(Object sender, EventArgs e) at
System.Windows.Forms.Form.OnLoad(EventArgs e) at
System.Windows.Forms.Form.OnCreateControl() at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl() at
System.Windows.Forms.Control.WmShowWindow(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.WmShowWindow(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.DebuggableCallback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32
msg, Int32 wParam, Int32 lParam) at
System.Windows.Forms.Form.SetVisibleCore(Boolean value) at
System.Windows.Forms.Control.set_Visible(Boolean value) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationContext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine) at AnatomyAlive.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at
System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at
System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel) at
System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() at
System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext
activationContext, String[] activationCustomData) at
System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext
activationContext) at System.Activator.CreateInstance(ActivationContext
activationContext) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException: