How to release memory

patrick

Well-known member
Joined
Dec 5, 2021
Messages
305
Programming Experience
1-3
Hello

How does FtpWebRequest, WebResponse Release memory?

I don't know how to free this(FtpWebRequest, WebResponse) memory.

C#:
FtpWebRequest Request = (FtpWebRequest)WebRequest.Create(url);
...
    Request.Close(); ??

C#:
WebRequest Request = WebRequest.Create("http://www.con.com");
...
    Request.Close(); ??


Thank you
 
You just let go of your reference to the object. The garbage collector will release the memory when garbage collection occurs.

C#:
Request = null;
 
Back
Top Bottom