Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 29th, 2008, 09:39 PM
Registered User
Join Date: Jun 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default "OutOFMemoryException"

I am working in Visual Studio 2005, and am running a model that is meant to run through 500000 clients, and project things for them 25 years in the future.

In each years loop, different dll functions are called and values obtained.

The model runs though around 300000 clients successfully before crashing with the "OutOfMemoryException" message. Under numerous runs, it has been seen that no particular borrower, or no particular dll function is the source of the problem, but it always crashes on a dll function.

I have tried to clear memory by using GC.Collect(), but it has made no difference.

Is there anything I can be looking at to clear memory, help the programme run though?



  #2 (permalink)  
Old April 30th, 2008, 10:51 AM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

I'm not surprised that GC.Collect() has no effect. The GC runs automatically when space is needed. If collection could fix the problem it would be automatically done for you through that methodology.

It certainly appears to me that you have a memory leak. I have not addressed anything like this, but in thinking about what I would do if this happened to me (in addition to posting a question on WROX P2P, which I certainly would do—as you have), is add a reporting mechanism (to be removed once the problem is solved), and use APIs or the functionality of .NET to report memory stats when you anticipate consuming memory, and where you anticipating reclaiming memory, to see if you can detect an imbalance.

Perhaps—without actually determining the culprit—loading the DLL just once, and adding a re-initialization method to be used prior to each loop will make you “leak” the memory just once, which apparently is not a problem (since the error isn’t fatal until after 300,000 iterations).

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
System.outOfMemoryException dhol General .NET 2 December 29th, 2004 08:45 AM

All times are GMT -4. The time now is 01:48 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.