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 June 28th, 2007, 01:51 AM
Authorized User
 
Join Date: Jun 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to handle OutOfMemory Exception

I keep getting this OutOfMemory Exception. Sometimes it is consistent, it occurs everytime I try to fetch data from the backend. Sometimes it is inconsistent, it does not happen always.

As a result of this error message, no records are available at the frontend. This affects production significantly.

Kindly advice me how to combat this problem.

Here are some solutions I have tried and was unsuccessful:

* Transferring the records in batches. Instead of sending 100 records in one shot, I send 10 records at a time (or) instead of sending around 50 columns I fetch 10 columns at a time (with all the records)

* Multithreading. I am working on it currently.

Sometimes this problem occurs, even if the number of records is very less (less than 50). It is not clear what creates this problem.
 
Old June 28th, 2007, 08:33 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

It would stand to reason that your hardware is lacking memory. What kind of data are you retrieving? How large are the records? I have retrieved hundreds of thousands of records in past projects and not encountered this kind of problem.

Multithreading is unlikely to solve this. Splitting a process up into multi threads isn't going to reduce the memory required by the process as a whole. It just reduces the memory demand of each single thread. In fact, it would probably INCREASE the memory demands because you are introducing thread management to the process.

-Peter
 
Old June 28th, 2007, 11:31 PM
Authorized User
 
Join Date: Jun 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Peter,

I agree. In fact I have a different screen that fetches around 7000 records and works fine. I do not get Out of Memory exception.

I do not know what causes this exception. It is unlikely to be hardware problem, because the other screen that performs well, retrieves so many records and yet doesn't complain.

I just do not have any lead towards a solution. Please give me ideas/suggestions.

 
Old June 29th, 2007, 12:05 AM
Registered User
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to atilak_2001
Default

Please specify your backend and the mathod you fatch your records. A piece of code causing erorr will be useful too.

-Ash

Positiveness is in my blood.. I'm O+.
 
Old July 3rd, 2007, 07:23 AM
Authorized User
 
Join Date: Jun 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default



I provide some more information regarding the problem that could be useful

* I have a middle tier between the front end and the backend. There is no problem when the records move from the back end to the middle tier. The problem seems to be when the records come to the front end.

* Oracle backend.

* I invoke the middle tier through remoting. The middle tier methods in turn invoke Oracle.

* The records move from the middle tier to front end in compressed format. Actually the return value is a dataset, that is compressed using DeflateStream, and in the front end it is decompressed. The compressed format is a byte array. The retrieved byte array is restored to dataset in the front end.








Similar Threads
Thread Thread Starter Forum Replies Last Post
How can handle OutOfMemory Exception jazzydonald Pro Visual Basic 2005 2 October 5th, 2007 07:10 AM
How to handle the JSP Exception in Java sheetm JSP Basics 0 December 5th, 2006 03:14 AM
How to handle error or exception if it occurs popoxinhxan BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 August 27th, 2006 06:44 PM
How to handle...? chawnu Pro PHP 1 December 8th, 2005 05:14 AM
System.OutOfMemory Exception Ron Howerton ASP.NET 1.0 and 1.1 Professional 7 November 30th, 2005 10:08 AM





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