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...
This configuration is supported: it's very similar to Windows Vista as far as the profiler is concerned.
I've just tried this on one of our VMs running 2008 x64 and I can't reproduce the problem you are having, either by running the profiler as an administrator or a restricted user. We're using the Enterprise edition, but it's not clear if that could make a difference here.
The trigger process is used for running tasks as different users and for attaching to processes running in WOW64. It's started automatically on 64-bit systems that have .NET 4 installed for this reason. The error you see occurs if it fails to contact the main UI after 30 seconds. It has been known to occur in our VMs if they are very heavily overloaded (as the process was taking more than 30 seconds to start)
The trigger process is not run if you don't have .NET 4 and don't perform any actions that require elevation. It communicates with the UI via an IPC pipe.
I'm assuming from your description that this problem is occurring before the 'start profiling' dialog is displayed (it's likely to be an elevation failure of some kind if it's happening later)
Are you running ANTS as an administrator or a restricted user?
If you're running as an administrator, is UAC turned on?
If you have task manager running while you're starting the profiler, do you see the RedGate.Profiler.Trigger process starting? Has it quit or is it still running at the point that ANTS displays the error?
If it's the _x86 variety of the trigger process, is it actually running as a 32-bit process? (This is a long shot, but if this was running 64-bit for some reason then you'd see this error) / comments
This configuration is supported: it's very similar to Windows Vista as far as the profiler is concerned.
I've just tried this on one of our VMs running 2008 x64 and I can't reproduce the problem yo...
No, this won't cause any problems. AMP5 pre-dates the release of .NET 4 so it operates in a compatibility mode. .NET 4 just produces a warning message to let you know that this is happening. The main change in .NET 4 that affects the profilers functionality is that the layout of string objects has been changed, so version 5 of the profiler is unable to display their values.
Version 6 of the profiler has been updated to fully support the new .NET 4 profiling interface. / comments
No, this won't cause any problems. AMP5 pre-dates the release of .NET 4 so it operates in a compatibility mode. .NET 4 just produces a warning message to let you know that this is happening. The ma...
One thing that might be worth trying is unsetting the baseline snapshot before saving: the profiler requires much less memory if it's not performing a comparison.
Reducing the number of performance counters that are being recorded may help with very long sessions as well. / comments
One thing that might be worth trying is unsetting the baseline snapshot before saving: the profiler requires much less memory if it's not performing a comparison.
Reducing the number of performance...
This assignment will appear to the profiler as the first line of the method corresponding to the class constructor. If you have line-level timings turned off, or the profiler was unable to instrument the constructor, then this will indicate all of the time used in the constructor overall (same as any other method in the line-level display).
If line-level timings are enabled, this time may include some compiler-generated code that normally goes before the first line of the constructor is executed such as the call to the base class's constructor. / comments
This assignment will appear to the profiler as the first line of the method corresponding to the class constructor. If you have line-level timings turned off, or the profiler was unable to instrume...
Yes, that should work: if you're using a project file with the option turned on, then the command line should enable the feature the same way the UI does, so if it works in the UI on a given system then it should also work with the command line.
The data has to be viewed via the UI after being saved out with the /data option.
The problem is that there's almost no feedback if a problem occurs as things stand, so there isn't much opportunity to correct problems at the moment. This will be rectified in v6.1. / comments
Yes, that should work: if you're using a project file with the option turned on, then the command line should enable the feature the same way the UI does, so if it works in the UI on a given system...
I've just tried this out, and I think it does work if you use a project file. There's no way to switch this option on without using one at the moment, which is an oversight on our part.
However: this feature only works if the profiler is launched as an administrator. The command-line tool doesn't perform elevation like the UI does, and the resulting error is not being reported.
I think that it's probably correct that the command-line doesn't automatically try to elevate itself, as the UAC prompt is probably the last thing you want to appear when running non-interactively.
This does reveal several changes we do need to make, though:
* We need to add a 'record sql/file events' option so that a project file isn't always necessary to enable this feature.
* We need to display a clear warning when a profiling session requires administrator permissions to work correctly and these aren't available.
* If there are any errors while recording events, these should be displayed as warnings when profiling finishes.
I don't think any of these are major modifications, so I'd be confident scheduling these for v6.1. / comments
I've just tried this out, and I think it does work if you use a project file. There's no way to switch this option on without using one at the moment, which is an oversight on our part.
However: th...
Hi,
ANTS shouldn't miss any methods when using any of the 'all methods' profiling modes. However, there are a few options that can change how this is presented to you:
If 'Enable Inlining' is on (it is by default), then .NET may inline certain methods, which the profiler will report as taking no time as a result. These will only show up in the results (in orange) if you have 'hide insignificant methods' turned off.
'Simplify complex stack traces' can sometimes results in method disappearing. Turning this option off might result in the profiler using up too much memory and crashing the target application.
If 'avoid profiling extremely trivial functions' is on, then the profiler will save disk space and memory by ignoring methods with an infinitesimal effect on the result (this generally means property accessors that are only called once).
If you're using sampling mode, be aware that the profiler won't be able to see function calls that take place in an interval less than the sampling period - generally anything that takes less than about 2ms to complete; about 99% of .NET function calls actually fall into this category.
It might also be the display options: to see everything make sure that you've selected an 'any methods' display mode and turned 'hide insignificant methods' off. / comments
Hi,
ANTS shouldn't miss any methods when using any of the 'all methods' profiling modes. However, there are a few options that can change how this is presented to you:
If 'Enable Inlining' is on (i...
This error generally happens because the line-level timings won't work when applied to partially trusted code. You can try adding an option to the command line parameters to turn this feature off, or you could temporarily change the assembly that's throwing the exception to be full-trust for profiling.
We're considering alternative ways of achieving the line-level support that will avoid this particular problem for v7. / comments
This error generally happens because the line-level timings won't work when applied to partially trusted code. You can try adding an option to the command line parameters to turn this feature off, ...
I haven't been able to find anything on Microsoft's site about this problem, though I can write my own assembly marked as SecurityTransparent and call P/Invokes from it.
A fix for the .NET issue wouldn't help with the profiler, however, as the problem is due to code being generated by the profiler that can't run in a SecurityTransparent assembly. The only difference would be that the program would crash with an exception instead of an access violation.
We'll look into fixing this in a minor release: the solution will probably have to be to disable line-level timings for SecurityTransparent methods. / comments
I haven't been able to find anything on Microsoft's site about this problem, though I can write my own assembly marked as SecurityTransparent and call P/Invokes from it.
A fix for the .NET issue wo...