Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GC does not release memory...memory keeps growing!!!

Reply
Thread Tools

GC does not release memory...memory keeps growing!!!

 
 
Mahesh Prasad
Guest
Posts: n/a
 
      12-31-2003
Hi,

I'm having a very very frustrating experience with the .NET. I've a simple
crawler console application.
The main objective of the crawler is to read a list of URLs and make HTTP
calls to a web server and save
the html files locally.

I had setup perfmon to monitor the memory usage of the application. I found
that the Gen 2 heap size keeps increasing
and ultimately the system runs out of memory. Whereas Gen 0 and Gen 1 heap
size is stable (it increases and decreases as GC runs).

I understand that the objects that have lived long enough are ultimately
promoted to Gen 2. But none of my objects have
that much state information to cause the Gen 2 heap to grow incessantly!!
I'm using many temporary objects like
HttpWebRequests, StringBuilder and Streams. But these objects live only as
long as the HTTP request lasts. I'm not
saving these objects as my class members.

I would appreciate if someone can throw some light on this strange
behaviour. I'm so frustrated that I'm planning to
re-write the code in C++.....atleast I'll have control over when the memory
is to be released.

Thanks in advance.

Mahesh


 
Reply With Quote
 
 
 
 
Tom Wells
Guest
Posts: n/a
 
      02-22-2004
Make sure you call Dispose on all objects that have a Dispose, same with
Close methods....



"Mahesh Prasad" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
>
> I'm having a very very frustrating experience with the .NET. I've a simple
> crawler console application.
> The main objective of the crawler is to read a list of URLs and make HTTP
> calls to a web server and save
> the html files locally.
>
> I had setup perfmon to monitor the memory usage of the application. I

found
> that the Gen 2 heap size keeps increasing
> and ultimately the system runs out of memory. Whereas Gen 0 and Gen 1 heap
> size is stable (it increases and decreases as GC runs).
>
> I understand that the objects that have lived long enough are ultimately
> promoted to Gen 2. But none of my objects have
> that much state information to cause the Gen 2 heap to grow incessantly!!
> I'm using many temporary objects like
> HttpWebRequests, StringBuilder and Streams. But these objects live only as
> long as the HTTP request lasts. I'm not
> saving these objects as my class members.
>
> I would appreciate if someone can throw some light on this strange
> behaviour. I'm so frustrated that I'm planning to
> re-write the code in C++.....atleast I'll have control over when the

memory
> is to be released.
>
> Thanks in advance.
>
> Mahesh
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[RELEASE] Python 2.7 release candidate 1 released Benjamin Peterson Python 3 06-06-2010 07:33 PM
convert "quick" release to "slow" release tripod head plate Mike Digital Photography 0 05-17-2009 11:01 AM
Adding quick-release to a non-quick-release tripod head ste7esmith@hotmail.com Digital Photography 4 11-20-2006 03:19 PM
J2ME: javac: target release 1.1. conflicts with default source release 1.5 John Goche Java 1 12-17-2005 08:12 PM
NEWS RELEASE: Leone's "Nobody" Films 1st time mastered in HD for DVD release with 240 Minutes Extras Torsten Kaiser \(TLEFilms\) DVD Video 1 06-06-2005 03:17 PM



Advertisments