Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2007, 08:38 AM
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default System out of memory exception

Hello



We have done a client server socket programming using Visual C# 2005 and SQL SERVER.

The program works fine. But if there are many clients accessing the socket we stumble on the error

"System out of memory exception"



I will give out the details of the server socket.

1. We recieve all the details from the client

2. These details are in recieved in bytes which we convert into a string array

3. These details if proper will be written to the log file(if input details are right) or error log file(if details are wrong)

4. Thereafter these details will be displayed in a listbox(Problem arises here)

4.a) . If the details already exist it will be ignored.

5. We have used another thread which will inspect if there is another details coming in from client socket and this is taken care of and written in the list box.

6. We have also used

Control.CheckForIllegalCrossThreadCalls = false;

7.Now when there are many clients accessing the server while one is accessing the data from the listbox the second also takes the same data from the list box and that results in the error

System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
   at System.Windows.Forms.ListBox.NativeAdd(Object item)
   at System.Windows.Forms.ListBox.ObjectCollection.AddI nternal(Object item)
   at System.Windows.Forms.ListBox.ObjectCollection.Add( Object item)
   at StepIIServer.Server.RunClient2() in E:\stepII\Server.cs:line 346







Can anyone throw some light on this error.

I am running into these troubled waters for the past week.



In case of doubts I will try to clarify.



Regards







Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto Serialize System.Exception? jacob C# 3 November 6th, 2006 12:12 PM
Macro eating up system memory Abhinav Excel VBA 1 December 20th, 2005 03:58 AM
System.OutOfMemory Exception Ron Howerton ASP.NET 1.0 and 1.1 Professional 7 November 30th, 2005 10:08 AM
System.Exception .aspx website dephjam C# 3 April 13th, 2005 07:59 PM
crystal reports - Out of memory exception prasan BOOK: Professional Crystal Reports for VS.NET 2 July 28th, 2004 08:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.