Anatomy of a memory leak -'memory leak'
StreamReader sr;
using(sr = new StreamReader("somefile.txt"))
{
//do some stuff
}
Tags: .net performance memory-leaks com-interop
Source: By huseyint as answer to the question
This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 4.0
Related code-snippets:
- How do you calculate someone's age based on datetime?
- Difference between Math.Floor() and Math.Truncate().
- How can I get the value of in a loop?
- Do you like compression of files? How do you decompress them?
- How can I sync my SVN revision number with my ASP.NET web site?
- What is the catch all algorithm?
- How do you sort a dictionary by value?
- What is the most efficient code for 10000 prime numbers?
- If a.net Embedded Database runs on a network. Embedded Database can run off a network.
- How can I create an object instance from a Type?
- Localising Date format descriptors: A set of localised descriptors for localising the date format in an existing format.
- How is database indexing used?
- What is the most efficient graph data structure in Python?
- How should I limit the size of the QueueT> in.NET?
- How do you check for file locks?