Comments
Sort by recent activity
The message displays if the only reason the object is a GC root is that it's referenced by weak references, not if the only things that are referencing it are weak references. There would be no way to discover that an object has weak references pointing at
Weak references are confusingly named in a way: they aren't actually references at all. They work by creating a GC root for the object you specify. Unlike normal GC roots these don't force the object to stay in memory but just act as a placeholder. These aren't 'references' in the same way that assigning a variable creates a reference: it's two separate objects. One is usually (but not always!) a WeakReference object that knows about the GC root, and the other is the target object. 'Dereferencing' the weak reference involves looking up the object pointed to by the gc root.
Note that even with strong roots, there's no reason that an object which is a strong root can't have other references. If this were the case, you couldn't create a reference to an object stored in a static variable.
Also note that the WeakReference class isn't the only way to create a weak reference GC root: you can create them from unmanaged code, or using the GCHandle class.
The memory profiler won't show weak references in the object retention graph (as they aren't 'references' in the conventional sense), and won't count them in the distance to GC root column, so you can still use these to discover why the object is still in memory. / comments
The message displays if the only reason the object is a GC root is that it's referenced by weak references, not if the only things that are referencing it are weak references. There would be no way...
There are two variables that control where ANTS puts its data: RGTEMP and RGIISTEMP. RGIISTEMP only applies to IIS sessions, and RGTEMP applies to everything.
We don't use the standard temporary directories as this wouldn't work for a lot of profiling scenarios where the target process is running as a different user to the profiler UI. Note that if you do set the temporary directories yourself, you will also have to manually set the permissions for profiling these kinds of application (Windows services and IIS in particular) / comments
There are two variables that control where ANTS puts its data: RGTEMP and RGIISTEMP. RGIISTEMP only applies to IIS sessions, and RGTEMP applies to everything.
We don't use the standard temporary di...
Another new feature of the later versions is a sampling profiler - in this mode the overhead of the profiler is low enough that it can be considered to be effectively nonexistent in most cases.
In the instrumentation modes, which capture the most detail, there's effectively no way to turn the profiler on or off: once the JIT has done its work, the instrumentation is in place and can't be changed. Additionally, the profiler would still need to track program state even when it was not measuring timings, which means the main effect of having an 'on/off' switch would be to make the profiler run slower (with the switch in either state). The best way to improve performance is to turn down the amount of instrumentation that is performed - in particular, line-level timings can require a lot of processor time to deal with.
Most profilers have an on/off switch in any case to make it possible to limit the final results to a specific time period. ANTS doesn't need this because it has the timeline and the ability to return profiler results for any time period by dragging out a region, so it's possible to just ignore the results from uninteresting times and easy to look at many different areas of the program in a single run.
This is particularly aimed at applications with long setup times: it means that it's not possible to make a mistake that would result in the interesting part of the data being lost, and also makes it easy to take a peek at the early data to ensure that the profiler is indeed capturing what's required. / comments
Another new feature of the later versions is a sampling profiler - in this mode the overhead of the profiler is low enough that it can be considered to be effectively nonexistent in most cases.
In ...
The HRESULT is the interesting part: 0x8007007E means 'the specified module could not be found'. This implies that either the profiler core is not registered correctly, or one of its dependencies is missing.
The profiler UI checks the registration before trying to launch any application, so it's more likely that there is a missing dependency. Unfortunately, the error message provides no hint as to what this could be.
You can manually reregister it by running regsvr32 on the ProfilerCore dll contained within the ANTS distribution (you'll need to do both the version in the main directory and the one in the x64 directory if you're running 64-bit Windows). I suspect this will probably fail with the same HRESULT, though.
The profiler depends on the VC2010 runtime, the detoured dll (shipped with the profiler), mscoree.dll (ie, .NET), psapi.dll and ws2_2.dll (aka winsock). The DLLs are all part of the standard Windows distribution and should be found in your system32 directory. The VC2010 runtime should be installed by the ANTS installer if it's not already present, but you can install it manually from here: http://www.microsoft.com/download/en/de ... px?id=5555 http://www.microsoft.com/download/en/de ... x?id=14632
Note that v5 of ANTS was built with Visual Studio 2008SP1, so you'll need a different version of the runtime installed for that version. / comments
The HRESULT is the interesting part: 0x8007007E means 'the specified module could not be found'. This implies that either the profiler core is not registered correctly, or one of its dependencies i...
There is an API available for ANTS which can mark regions on the timeline: see 'adding custom event markers' here for details. Once the regions are marked, you can just select those relating to the tests you're interested in.
However, this is probably unncecessary for unit tests: as these are implemented as individual methods, you can just select the relevant method in the list. ANTS will draw a green bar on the timeline to show the times when the method was running, and you can click on this to inspect what was going on during that time. The call graph is also very useful for inspecting how an individual method is behaving. / comments
There is an API available for ANTS which can mark regions on the timeline: see 'adding custom event markers' here for details. Once the regions are marked, you can just select those relating to the...
All of the issues that we know of that could result in this behaviour should have been fixed by the 6.3 update.
However, this might not solve your issue: as detailed above, the 'summarising' screen would most commonly show up when the target application exited before providing any profiling data. This most commonly happens with profiling sessions that target Internet Explorer in some way (Silverlight, XBAP or ASP.NET sessions), generally due to the security settings in IE causing the profiler to be kicked out of the session.
Newer versions of the profiler will display the proper 'no results' message in these cases. Generally, switching off protected mode in IE is all that's needed to work around the problems (quitting any other open instances can sometimes be required as well).
I'm not aware of any issues that specifically hit WPF applications that could result in this. One trick you can try with desktop applications is to profile cmd.exe and then launch the applications you want to profile from there: ANTS won't end the session until the command window is closed. / comments
All of the issues that we know of that could result in this behaviour should have been fixed by the 6.3 update.
However, this might not solve your issue: as detailed above, the 'summarising' screen...
ANTS reports the same values here as perfmon would. Unfortunately, Microsoft's implementation of performance counters are glitchy and can produce out of range values like this. Normally it happens if they're read too frequently, but this can also happen at times of high system load.
The same effect will be visible in perfmon, but it's not as noticeable as perfmon overwrites previous data after a minute.
There's not a lot that ANTS can do about this: the most common glitch is to read too low, which can't be distinguished from a valid value. With some counters, like this one, it will 'make up' the 0 values with a large spike - note that the spike is in the middle of a series of values that are 0. The real value was probably constant at 100 over that time, and the performance counter has chosen glitchy values that wind up averaging out to about that over a longer period of time. / comments
ANTS reports the same values here as perfmon would. Unfortunately, Microsoft's implementation of performance counters are glitchy and can produce out of range values like this. Normally it happens ...
springy wrote:
Since the profiler already has the possibility to filter by a specific thread, why not capture the thread which triggered the user-event (or the creation of a pinned region).
There's certainly some room for improvement in this regard, but there is a way to achieve what you want in ANTS 6. If you select a small region around the the user event, you can click the event to select the method that it occurred in.
The time the method was executing will appear as a green bar in the timeline: you can now click this to select the entire time that that particular method was executing - additionally, the tooltip for the bar will tell you which thread it was running in. You can also switch to the call graph to analyse only the time spent in that particular method. / comments
springy wrote:
Since the profiler already has the possibility to filter by a specific thread, why not capture the thread which triggered the user-event (or the creation of a pinned region).
Th...