 |
|
รันโปรแกรม C# แล้ว มันขึ้น OutOfMemoryException ทำอย่างไรดีคะ |
|
 |
|
|
 |
 |
|

รันไปได้สักพักแล้ว มันขึ้นรูปนี้ แล้วก็มีขึ้นข้อความข้างล่างนี้แทนผลลัพธ์ ต้องทำอย่างไรดีคะ
ขอบคุณมากๆค่ะ
Code
A first chance exception of type 'System.OutOfMemoryException' occurred in mscorlib.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>vrp.vshost.exe</AppDomain><Exception><ExceptionType>System.OutOfMemoryException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Exception of type 'System.OutOfMemoryException' was thrown.</Message><StackTrace> at System.Collections.ArrayList.set_Capacity(Int32 value)
at System.Collections.ArrayList.EnsureCapacity(Int32 min)
at System.Collections.ArrayList.Add(Object value)
at vrp.Form1.convertToArray(String a) in C:\Users\PUI\Desktop\yam\vrp\vrp\Form1.cs:line 617
at vrp.Form1.cal() in C:\Users\PUI\Desktop\yam\vrp\vrp\Form1.cs:line 82
at vrp.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\PUI\Desktop\yam\vrp\vrp\Form1.cs:line 753
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message&amp; m)
at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)
at System.Windows.Forms.Button.WndProc(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
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(Form mainForm)
at vrp.Program.Main() in C:\Users\PUI\Desktop\yam\vrp\vrp\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.ArrayList.set_Capacity(Int32 value)
at System.Collections.ArrayList.EnsureCapacity(Int32 min)
at System.Collections.ArrayList.Add(Object value)
at vrp.Form1.convertToArray(String a) in C:\Users\PUI\Desktop\yam\vrp\vrp\Form1.cs:line 617
at vrp.Form1.cal() in C:\Users\PUI\Desktop\yam\vrp\vrp\Form1.cs:line 82
at vrp.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\PUI\Desktop\yam\vrp\vrp\Form1.cs:line 753
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message&amp; m)
at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)
at System.Windows.Forms.Button.WndProc(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
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(Form mainForm)
at vrp.Program.Main() in C:\Users\PUI\Desktop\yam\vrp\vrp\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()</ExceptionString></Exception></TraceRecord>
Tag : .NET, C#
|
|
 |
 |
 |
 |
Date :
2012-05-24 15:39:51 |
By :
yam19 |
View :
3306 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Debug แล้วอา Code Line ที่มีปัญหามาดูครับ 
|
 |
 |
 |
 |
Date :
2012-05-24 17:12:44 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนนี้มันกลายเป็นปัญหานี้แล้วอ่ะค่ะ

โปรแกรมรันไปได้เท่านี้ก็เกิดปัญหา
JOB: 7 Truck: 1 Num_Node: 1 Distance: 1395 SumDistance: 1395 Path: 7, 7,
JOB: 7 Truck: 2 Num_Node: 1 Distance: 1269 SumDistance: 1269 Path: 7, 7,
JOB: 7 Truck: 3 Num_Node: 1 Distance: 1446 SumDistance: 1446 Path: 7, 7,
JOB: 9 Truck: 1 Num_Node: 1 Distance: 1146 SumDistance: 2415 Path: 9, 9,
โดย Job มีทั้งหมด 20 Job มี Truck 3 คัน ครั้งที่แล้วก็ Error ตอนคันที่ 2 ตอนนี้ก็เหมือนกัน
ขอบคุณมากนะคะ
|
 |
 |
 |
 |
Date :
2012-05-25 10:31:58 |
By :
yam19 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำได้แล้วค่ะ
ขอบคุณมากนะคะ
|
 |
 |
 |
 |
Date :
2012-05-25 11:02:09 |
By :
yam19 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตกลงเป็นเพระาอะไรครับ
|
 |
 |
 |
 |
Date :
2012-05-25 16:07:08 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|