| Author |
Message |
abhijeet2083
Joined: 03 Nov 2011 Posts: 2
|
Posted: Thu Nov 03, 2011 10:44 pm Post subject: RedGate.MemoryProfiler.Snapshot.TakeSnapshot() returns false |
|
|
I am trying to get a snap shot from a very simple winform app when the profiler is running.
But RedGate.MemoryProfiler.Snapshot.TakeSnapshot("asd") always return false without any delay.
Any help appreciated.
Abhijeet |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Mon Nov 07, 2011 12:55 pm Post subject: |
|
|
AFAIK this method should throw an exception if there is a problem and the return codes for this method are undocumented but just to clear up any potential misunderstanding:
- Is ANTS Memory Profiler running at the same time as the application for which you've incorporated the snapshot API?
- If so, does ANTS Memory Profiler inform you that it is taking the snapshot "asd" in its' UI?
- If so, are any exceptions occurring in the Memory Profiler UI at the time the snapshot was invoked?
_________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
abhijeet2083
Joined: 03 Nov 2011 Posts: 2
|
Posted: Mon Nov 07, 2011 8:33 pm Post subject: RedGate.MemoryProfiler.Snapshot.TakeSnapshot() returns false |
|
|
Thanks for the reply.
Firstly answering your questions,
- Yes, the profiler & the app invoking API are running at the same time.
- After the API invoke, there is absolutely no change on the profiler UI.
Here is something I should have mentioned in my first post.
- I got a COM unregistered exception when I tried for the first time.
- That was when I registered the assembly RedGate.Memory.Core.dll from its location inside Program Files.
- And its after this register is the behavior mentioned in the first post. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Tue Nov 08, 2011 11:31 am Post subject: |
|
|
Well, according to the source code, TakeSnapshot returns false if- Profiler is not connected to the process
- The memory profiler control can't be referenced (problem with RedGate.Memory.Core.dll)
- Profiler busy detaching with the process (or a COM exception occurs)
So I guess I would check the first thing by trying to take a snapshot in the UI. Mem profiler has probably crashed the process or it's exited on its' own. According to your last update you registered RedGate.Memory.Core.dll. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
jrg
Joined: 02 Jul 2010 Posts: 13
|
Posted: Mon Nov 21, 2011 6:27 pm Post subject: |
|
|
Just a thought - the snapshot API requires the profiled process to be started by the profiler - it's not enough for them to run at the same time.
Start ANTS Memory Profiler.
Set up ANTS Memory Profiler to profile your application in the normal way.
When you click [startprofilingbutton] your application starts.
Snapshots are taken automatically at the trigger points you defined in your code.
| Quote: |
| I got a COM unregistered exception when I tried for the first time. |
That's odd, because the memory profiler's installer should have registered the COM object. Were there any problems running the installer?
| Quote: |
| return codes for this method are undocumented |
There aren't any return codes as such, it either works (returns true), or fails (returns false), or throws an exception when the snapshot rate limiting is exceeded (5 in 30 seconds). |
|
| Back to top |
|
 |
|
|
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