Large Virtual Allocation using calls to NtVirtualMemory

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
thedebugger
Posts: 1
Joined: Mon May 07, 2007 4:04 pm

Large Virtual Allocation using calls to NtVirtualMemory

Post by thedebugger » Mon May 07, 2007 4:13 pm

Hi,

I am profiling my application with Mem Profiler 3.0. I have noticed that application allocate Virtual Memory. No Wrappers, All objects are getting Disposed but 6-7 Mb of Virtual Memory allocation is observed. When profiling application i usually measure the Private Bytes/ Commited Bytes and i observed that the Virtual Memory allocations are High particularly when the any operation is performed for very first time. I am unable to find a way to Deallocate the Virtual Memory, Is there any way to deallocate the virtual memory? Is this a natural behavior of any .NET application?

Regards
Debugger

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Mon May 07, 2007 9:12 pm

Hi,

The runtime allocates memory for its internal structures using VirtualAlloc. In a normal application there are quite a few other libraries loaded as well, and they might also allocate some memory using VirtualAlloc. I don't think that it's necessary to worry about 6-7 MB of Virtual Memory when profiling a .NET application. What you should keep an eye on is whether this memory usage increases. For example, if you perform some action and the memory usage increases each time the action is performed. If you see this behavior, it is probably a good idea to investigate the issue further.

So, I believe that this could be considered natural .NET behavior, and it is probably not possible to deallocate this memory.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests