Red Gate forums :: View topic - Non stopping snapshot
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

Non stopping snapshot

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



Joined: 07 Dec 2011
Posts: 7

PostPosted: Wed Dec 07, 2011 5:59 pm    Post subject: Non stopping snapshot Reply with quote

Hi everybody,

i've tried to find qnswers to my problem on this forum, but I didn't find one...

I've a Winform application to profile, in order to understand how memory is managed, and explain crashes on 32bits platforms. This application is written in C#, and call a C++/Win32 API, via a C++/CLI client library.

It seems that memory is completely occupied by unmanaged memory, because Private Bytes are high (1 Go) while Bytes in Heaps are low (50 Mo).

Problem is : I've launched a snapshot 40 min ago, AND IT'S STILL RUNNING !!

I've reproduced it a few times (100% reproductible). It seems to happen once I've made a certain action on the UI (opening a custom project and gathering data). Before doing this action, I'm able to take some snapshots quite fast (a few seconds, less than a minute), and memory is about 512 Mo (private bytes)

Does anyone know how to handle it ?

I think I'll wait very long (maybe all night)
Back to top
View user's profile Send private message
JeromeAvoustin



Joined: 07 Dec 2011
Posts: 7

PostPosted: Thu Dec 08, 2011 10:31 am    Post subject: Reply with quote

Well... bad experience...
the computer switched off during the night
I'm trying to make another long snapahot (45 min from now...)

Any help would be appreciated
BTW I'm going to test Yourkit and dotTrace...
I hope they'll work...
Back to top
View user's profile Send private message
AndrewH



Joined: 17 Aug 2006
Posts: 137

PostPosted: Thu Dec 08, 2011 3:11 pm    Post subject: Reply with quote

Are any processes using CPU while the snapshot is taking place? v7.0 and earlier of the profiler had a bug where the progress bar would not hide after a snapshot had completed (the cases we know about were fixed in v7.1). Additionally, if the target process is responsive, then the snapshot has completed and something has gone wrong with the ANTS UI.

For 50Mb of .NET objects, a snapshot shouldn't take more than a second, and we've tested the profiler up to 30 million objects (which is about as many as you can possibly fit into a 32-bit process) - at this extreme, it still shouldn't take more than 5 minutes or so to take a snapshot and load it in.
_________________
Andrew Hunter
Software Developer
Red Gate Software Ltd.
Back to top
View user's profile Send private message
JeromeAvoustin



Joined: 07 Dec 2011
Posts: 7

PostPosted: Thu Dec 08, 2011 3:23 pm    Post subject: Reply with quote

Hi Andrew,

Thanks for your answer.
Well, I still don't understand why the profiler still runs.

ANTS UI is responsive, and I can see memory counters graph movig, I can zoom on it, etc.
On the other hand, the application UI isn't responsive anymore.
And no other process is running.

I'm running the whole on Windows XP 32bits SP3.
This is the platform where we encounter our memory problems.
Back to top
View user's profile Send private message
JeromeAvoustin



Joined: 07 Dec 2011
Posts: 7

PostPosted: Thu Dec 08, 2011 3:24 pm    Post subject: Reply with quote

Do you know if it is possible to get a thread dump of memory profiler to sse where it is blocking ?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6647

PostPosted: Fri Dec 09, 2011 2:36 pm    Post subject: Reply with quote

Since Memory Profiler introduces some code into your program as it's being profiled, it is possible that it's caused a synchronization or blocking issue in there, but we would need a stack dump to see if this is the case.

You can create a memory dump using adplus. If you want to do that, let me know and I will set up a private FTP account for you to send the dump and PM you with the login details.

To get the dump:
  • download ftp://support.red-gate.com/utilities/autodumper.zip
  • Extract all files (eg to c:\dumper)
  • While your process is being profiled and still running, open a command prompt and type:
  • cscript adplus.vbs -hang -pn <name of the process you are profiling>
  • Another window should open running cdb.exe
  • If the application is stalled, adplus should write a full memory dump (.dmp file in a subfolder of c:\dumper)
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6647

PostPosted: Mon Dec 12, 2011 1:04 pm    Post subject: Reply with quote

It looks from the stack trace like there is some sort of deadlock caused by an access violation that tries to shut down the .NET Runtime. The runtime doesn't shut down, though. Do you see any dialogs that need to be closed or anything?

If not, can you please try adplus in "crash" mode? We would be interested in any 1st/2nd chance exceptions happening in the program. (cscript adplus.vbs -crash -pn <name of process>)
Back to top
View user's profile Send private message
JeromeAvoustin



Joined: 07 Dec 2011
Posts: 7

PostPosted: Tue Dec 13, 2011 6:11 pm    Post subject: Reply with quote

Sorry, I didn't notice your post.
I'm gonna try it tomorrow if you don't mind.
It's in my toto-list.

I come back to you ASAP
Back to top
View user's profile Send private message
JeromeAvoustin



Joined: 07 Dec 2011
Posts: 7

PostPosted: Wed Dec 14, 2011 1:22 pm    Post subject: Reply with quote

Hi Brian,

I've launched the script but it didn't seem to "move" until I pressed ctrl+C.
It has started to produce some data.
When this is finished, I'll send it to you.

By the way, I've managed to NOT reproduce the problem, and to finally generate a snapshot quite quickly.
Our analysis was made on a Windows XP SP3 32bits.
And we've seen that the overall virtual memory needed by our application were not going above 2GB, which is the maximum XP 32bits can allocate to an application.
We've finally activated the /3GB switch of XP, and we didn't notice any Out of Memory error anymore, and as I said, we managed to take a snapshot.

I'll send you the crash report. But we might have found the problem.
It still doesn't explain why the snapshot isn't taken.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6647

PostPosted: Wed Dec 14, 2011 4:41 pm    Post subject: Reply with quote

Thanks - I'll have a look. I believe we have already tried to reproduce the issue by running the process out of memory but the Runtime did shut down and not hang up like it did in your case.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6647

PostPosted: Fri Dec 16, 2011 10:11 am    Post subject: Reply with quote

Sorry - we cannot isolate the cause of this because the .NET Runtime is not behaving correctly. It indicates it is shutting down but never completes the shutdown and there aren't any Profiler methods on the stack. If the Runtime never shuts down cleanly then ANTS Profiler can't finish what it is doing either.

Best suggestion we have is to try to prevent the access violation that is happening in your code but as this is your code we have no advice about how to do that.
Back to top
View user's profile Send private message
JeromeAvoustin



Joined: 07 Dec 2011
Posts: 7

PostPosted: Fri Dec 16, 2011 11:02 am    Post subject: Reply with quote

OK Brian,

Thanks to all the time you spent.
At least, I think taht it is simply a lack of virtual memory, causing a shutdown.
But there are too many technological stacks (C++/Qt, C++/CLR, C#, WPF) and both managed and unmanaged code that I think I won't find the answer for my part.

Jerome
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