Quote Originally Posted by Marraco View Post
probably that is the reasen because Notepat reserves 150 mb to read the 70 mb file.
The problem is, that, I tried to copy each string (one by one) into another array of strings. Then I make The OriginalString = Nothing, and even call GC.Collect, but it does nothing. the memory remains the same.

Probably each string allocates much more memory than needed.
Go back and REREAD my post. Go read the DOCUMENTATION.

Just becuase you are no longer referencing an object (setting something to nothing if it is going out of scope is BAD bractice) does NOT mean that the memory will be returned to the operating system, nor will you see a reduction in memory "usage".

This expectation is one of the clearest indicators that a person does not understand the very fundamentals of using .NET (this is not VB.NET specific).

Consider: (pseudo code)
Code:
for num = 1 to 1000000
    item = new Item()
    item.DoSomething();
next num
Clearly there will only be one "Item" in use at any time ( a total of one million will be created).

IF the computer system has sufficient memory to allocate all one million (ie GC does not run for the duration of the loop), there is NO problem.

IF GC (explicitly or implicitly) runs after the loop, the process will have already allocated significant memory from the OS. But there is no prima facia reason for the proces to return the memory to the OS.

Therefore a perfectly valid memory profile would be a rapid increase during the running of the loop, and the memory footprint of the process NEVER going down.