473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

FileStream class leaks handles??

Hi,

Has anyone seen a case where the FileStream class leaks handles? I have a program that runs in a loop and processes files in directories by reading them with a FileStream. Task manager shows that as the program runs the handle count rises and rises -- unless I comment out code that uses a FileStream. If I comment out the FileStream code the handle count stays fairly constant. Any ideas - I don't see anything in the knowledge base...

--Richard

Nov 16 '05 #1
1 1671
Richard wrote:
Hi,

Has anyone seen a case where the FileStream class leaks handles? I have a program that runs in a loop and processes files in directories by reading them with a FileStream. Task manager shows that as the program runs the handle count rises and rises -- unless I comment out code that uses a FileStream. If I comment out the FileStream code the handle count stays fairly constant. Any ideas - I don't see anything in the knowledge base...


FileStream is a disposable class - do you call FileStream.Close()?

Better yet, use the 'using' statement to ensure that your FileStreams
are properly disposed.

--
mikeb
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Toby Mathews | last post by:
Hi, In an ASP.Net application I want to convert open create a FileStream object from a System.Drawing.Image - is this possible? I create an instance of an Image object using the FromFile method,...
0
by: Steve Binney | last post by:
My code makes synchronous HttpWebRequest and HttpRebResponse calls. In VS 2003, I am getting memory leaks and event handle leaks. I am closing all streams and using "using"statements. I have...
0
by: Steve Binney | last post by:
My code makes synchronous HttpWebRequest and HttpRebResponse calls. In VS 2003, I am getting memory leaks and event handle leaks. I am closing all streams and using "using"statements. I have...
0
by: Steve Binney | last post by:
My code makes synchronous HttpWebRequest and HttpRebResponse calls. In VS 2003, I am getting memory leaks and event handle leaks. I am closing all streams and using "using"statements. I have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.