I have a program that requests HTML from a webservice, modifies the HTML to highlight search terms and then displays the HTML in a WebBrowser component. Sometimes the HTML I receive will be quite large causing my “Mem Usage” and “VM Size”, as displayed in task manager, to blow up to ~600 Meg. If I do not perform any other operation it seems my app will consume these memory resources indefinitely. If I do a forced GC I can get these resources released but am loathe to do that since I don’t really understand why the framework isn’t releasing the resources when they are no longer referenced.
I have two questions:
- Are “Mem Usage” and “VM Size” dependable metrics for what my program is consuming?
- If there are multiple .Net apps running on the same machine will the memory needs of one .Net app cause .Net to free resources from the other .Net applications?
Thanks in advance.
The garbage collector is a heavy operation so it gets done only when the system decides it’s necessary (ie there’s a memory pressure). The fact that 600MB are “blown up” has no impact as long as the system does not need them for something else.