Click here to Skip to main content
15,900,450 members
Home / Discussions / C#
   

C#

 
Generaladd item to Outlooks contactmenu Pin
Stephan Wright26-Jul-04 1:41
Stephan Wright26-Jul-04 1:41 
GeneralRe: add item to Outlooks contactmenu Pin
Heath Stewart26-Jul-04 10:54
protectorHeath Stewart26-Jul-04 10:54 
GeneralRe: add item to Outlooks contactmenu Pin
Stephan Wright26-Jul-04 12:45
Stephan Wright26-Jul-04 12:45 
GeneralRe: add item to Outlooks contactmenu Pin
Heath Stewart26-Jul-04 13:38
protectorHeath Stewart26-Jul-04 13:38 
GeneralRe: add item to Outlooks contactmenu Pin
Heath Stewart26-Jul-04 19:01
protectorHeath Stewart26-Jul-04 19:01 
GeneralCustom ListView - XP theme Pin
Andy H26-Jul-04 1:06
Andy H26-Jul-04 1:06 
GeneralRe: Custom ListView - XP theme Pin
Heath Stewart26-Jul-04 11:21
protectorHeath Stewart26-Jul-04 11:21 
GeneralCustom ListView - XP theme Pin
Andy H26-Jul-04 1:06
Andy H26-Jul-04 1:06 
GeneralDrawing Control Pin
blankg25-Jul-04 23:47
blankg25-Jul-04 23:47 
GeneralRe: Drawing Control Pin
Gary Thom26-Jul-04 7:19
Gary Thom26-Jul-04 7:19 
QuestionOutlook - right part of the window? Pin
BillyBlue25-Jul-04 23:11
BillyBlue25-Jul-04 23:11 
AnswerRe: Outlook - right part of the window? Pin
Heath Stewart26-Jul-04 11:20
protectorHeath Stewart26-Jul-04 11:20 
GeneralRe: Outlook - right part of the window? Pin
BillyBlue27-Jul-04 3:03
BillyBlue27-Jul-04 3:03 
GeneralRe: Outlook - right part of the window? Pin
Heath Stewart27-Jul-04 5:44
protectorHeath Stewart27-Jul-04 5:44 
GeneralRe: Outlook - right part of the window? Pin
BillyBlue27-Jul-04 6:06
BillyBlue27-Jul-04 6:06 
GeneralRe: Outlook - right part of the window? Pin
Heath Stewart27-Jul-04 6:17
protectorHeath Stewart27-Jul-04 6:17 
GeneralRe: Outlook - right part of the window? Pin
BillyBlue27-Jul-04 6:25
BillyBlue27-Jul-04 6:25 
GeneralRe: Outlook - right part of the window? Pin
Heath Stewart27-Jul-04 9:08
protectorHeath Stewart27-Jul-04 9:08 
GeneralRe: Outlook - right part of the window? Pin
BillyBlue27-Jul-04 9:43
BillyBlue27-Jul-04 9:43 
QuestionHow to use NotifyParentPropertyAttribute Pin
jjansen25-Jul-04 21:19
jjansen25-Jul-04 21:19 
AnswerRe: How to use NotifyParentPropertyAttribute Pin
Heath Stewart26-Jul-04 10:13
protectorHeath Stewart26-Jul-04 10:13 
GeneralRe: How to use NotifyParentPropertyAttribute Pin
jjansen27-Jul-04 21:02
jjansen27-Jul-04 21:02 
GeneralProblems with GC and HttpWebResponse Pin
Amir Zicherman25-Jul-04 8:38
Amir Zicherman25-Jul-04 8:38 
Hello,

I'm running the following program and getting memory leaks. The source of the leak is the "response = (HttpWebResponse)request.GetResponse();" line. When i close the connection to the response, it still won't clear up all the memory. I'm not sure why this is happening. I tried this code on an WinXP box with VS .NET 2002 and a Win 2003 Server box running Visual C# 2005 Express. I get leaks on both. I also tried calling GC.Collect() and GC.WaitForPendingFinalizers(), but that didn't help. Please let me know what i'm doing wrong here.

Thanx for the help, Amir



using System;
using System.Collections;
using System.Net;
using System.IO;

namespace GarbageCollectorTester
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{

public static string GetHTML(string url_)
{
HttpWebResponse response = null;
HttpWebRequest request= null;
try
{
Console.WriteLine("B: " + GC.GetTotalMemory(false));
request = (HttpWebRequest)(WebRequest.Create(url_));
response = (HttpWebResponse)request.GetResponse();
//Console.WriteLine("A: " + GC.GetTotalMemory(false));
}
catch(Exception e)
{
Console.WriteLine(e);
}
finally
{
if(response != null)
{
response.Close();
((IDisposable)response).Dispose();
}
request = null;
response = null;
//Console.WriteLine("A: " + GC.GetTotalMemory(false));
}
return "";
}

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
while(true)
{
GetHTML("http://www.hotornot.com");
}
}
}
}

GeneralRe: Problems with GC and HttpWebResponse Pin
Heath Stewart26-Jul-04 10:02
protectorHeath Stewart26-Jul-04 10:02 
GeneralRe: Problems with GC and HttpWebResponse Pin
Amir Zicherman27-Jul-04 7:59
Amir Zicherman27-Jul-04 7:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.