Red Gate forums :: View topic - Application is leaking Virtual Memory
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Memory Profiler 7
ANTS Memory Profiler 7 forum

Application is leaking Virtual Memory

Search in ANTS Memory Profiler 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
swisnieski



Joined: 15 Jul 2013
Posts: 1

PostPosted: Mon Jul 15, 2013 2:29 pm    Post subject: Application is leaking Virtual Memory Reply with quote

My application is leaking virtual memory. When running over the weekend, on Windows XP, the Task Manager shows the VM Size of the app to be growing. How do I find this type of leak ?
Back to top
View user's profile Send private message
davecove



Joined: 16 Jul 2013
Posts: 2
Location: United States

PostPosted: Tue Jul 16, 2013 6:28 am    Post subject: Reply with quote

Please excuse the 'me too me too', but it just so happens I am having the exact same issue right now.

ANTS shows that the Private Bytes, Page File Bytes, and Virtual Bytes are all increasing at the exact same slope, but the Working Set and Bytes in all Heaps are stable.

Private Bytes and Page File Bytes are superimposed on each other with Virtual Bytes somewhat higher, but again, on the exact same slope.

Can someone name the beastie I am hunting for?

Thank you for your time,
Dave
Back to top
View user's profile Send private message
Chris.Morter



Joined: 17 Jul 2013
Posts: 2

PostPosted: Wed Jul 17, 2013 5:29 pm    Post subject: Reply with quote

Swisnieski, is the usage of private bytes also increasing at the same time? If not then it is likely that the problem lies in unmanaged code because the CLR will ensure that only the necessary amount of virtual memory is used for .NET code. (If yes then see my reply to davecove below)

In C++ this sort of problem can happen if you use VirtualAlloc with the MEM_RESERVE parameter to reserve memory but then don't actually commit the memory later by calling VirtualAlloc with the MEM_COMMIT parameter. Memory that has been reserved buy not committed will be counted as virtual memory, but not towards private bytes, only once the memory is committed will it count towards private bytes. So a good place to start would be looking for calls to VirtualAlloc with the MEM_RESERVE parameter, without matched calls to MEM_COMMIT (or the equivalent functions in whichever unmanaged language you may be using).

Davecove, it sounds like you also have some form of unmanaged memory leak since the memory usage of the CLR heaps is stable. I think the fact that the virtual memory usage is increasing at the same rate and the other counters suggests you have a normal memory leak and the increase in virtual memory is just coincidental.

Unfortunately AMP 7 has little support for profiling unmanaged memory but we are hoping to ship a beta of AMP 8 within the next week which supports unmanaged profiling, so hopefully that will be able to help you pin down these issues.
Back to top
View user's profile Send private message
davecove



Joined: 16 Jul 2013
Posts: 2
Location: United States

PostPosted: Wed Jul 17, 2013 5:32 pm    Post subject: Reply with quote

Do I have to apply for the beta?

Dave
Back to top
View user's profile Send private message
Adam Parker



Joined: 18 Jul 2013
Posts: 1

PostPosted: Thu Jul 18, 2013 9:15 am    Post subject: ANTS Memory Profiler Beta Reply with quote

Hi Dave - You can sign up for the beta program here:

http://www.red-gate.com/labs/ants-memory-profiler/

Once you're signed up we'll get a beta build out to you. Any feedback you might have on the beta would be very welcome!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group