469,925 Members | 1,519 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,925 developers. It's quick & easy.

HttpWebResponse Memory Size Problems

Hello everyone I was wondering if anyone has come across my problem? I
programmed a Windows Service that uses httpWebRequest and httpWebResponse in
VB.NET. Everything works fine until I use the webresponse object. What the
Windows Service does is when the timer in the windows service elapses, the
request to the website is made and a response is retrieve in a simple
myhttpWebrequest.GetResponse(). I don't even do anything with the response,
and close out of the response immediately. But the Windows Service then
creates a connection for each call for the website and causes the memory to
increase to 30 MB. When I use a netstat on the server, I see multiple http
connections due to this Windows Service. I tried to set the timeout on the
myhttpWebRequest but it does nothing. Another person replied saying to use
the dispose method of the WebResponse, but that has been taken out of the
latest version. Is there a way to make the application to disconnect after
the connection and call to the website has been made? The code is
extrememly simple, create the webrequest, create a webresponse, close the
webresponse, and set the webrequest and webresponse to nothing in the timer
elapsed event. The event is called every 2 seconds, and runs well except it
continues to grow. Sometimes it will shrink slightly but still grow. I
updated the .NET to version 1.1 SP 1. I then added GC.Collect, but if I
recall correctly, GC.Collect does not release the memory back to the server,
and only releases it back to the program. Thanks.
Aug 25 '05 #1
0 1230

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Thomas Baier | last post: by
5 posts views Thread by meyousikmann | last post: by
2 posts views Thread by Brent | last post: by
reply views Thread by Randy Chow | last post: by
2 posts views Thread by Mike | last post: by
12 posts views Thread by David Given | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.