TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Manoj S Pant
NA
1k
1.1m
release memory from BinaryReader
Nov 28 2016 12:11 PM
Using fs As System.IO.FileStream = New FileStream(p_strPath, FileMode.Open, FileAccess.Read)
Using br As BinaryReader = New BinaryReader(fs)
br.ReadBytes(fs.Length) // here memory hold for file, need to free this free .
End Using
End Using
In above code when binary reader read bytes from file stream, it allocate the memory of file size into RAM, and this memory still block even after completion of this function, how can we release this memory, I am checking this memory from task manager.
Example :
Suppose my application consuming 80 MB size and when attached file of 100 MB then on br.ReadBytes(fs.Length), total memory consume by application is 80 + 100 = 180 MB.
but problem is that, 100 MB memory is not released even after completion of above function.
Question: How to release this 100 MB from application after completion of this function.
Reply
Answers (
1
)
foreach stament cannot operates on variables of type "Int"
get files of a specific format from a directory