How can we help you today? How can we help you today?
Andrew H
The intended behaviour hasn't really changed between the two versions, but ANTS 4 is very much faster than ANTS 3 and we took advantage of that to capture much more detail about the application being profiled. The Time measurement is intended to be the time spent exclusively in a certain method, excluding any methods that it calls (framework or otherwise). However, ANTS 3 did not measure the time spent in methods without source by default, so these would be measured as part of the method that made the call: this made the Time measurement inaccurate in the older version of the profiler. Time with children is the actual overall amount of time spent running a method. It's the best indication of which methods 'feel slow'. You may want to play with the CPU/wallclock time setting depending on what your application is doing to get the best view of the results. ANTS 3 didn't have this option and always showed wallclock time. ANTS 4 does have a similar feature, you can set it to profile only methods with source, and it will show timings in the same way as before if you choose this option. However, as there is much less detail, there will be no indication of why a particular method is slower, and ANTS 4 doesn't have line-level timing support in this mode. We've added a much better way of exploring how functions relate to each other, though, in the form of the call graph. If you've found that the Select method is taking a lot of time, but want to relate it to your code, you can click the call graph icon next to the call and expand it upwards to find your methods: if it's called from many different places, you will see all of them drawn out as a tree and how much time each of your methods is spending in the Select call. / comments
The intended behaviour hasn't really changed between the two versions, but ANTS 4 is very much faster than ANTS 3 and we took advantage of that to capture much more detail about the application bei...
0 votes
gpeszek wrote: I am having the exact same issue: the UI is stuck in "Starting service" and there is no profiling. Andrew, when you say The cheapest way to get around it is to reconfigure the service to run as LocalSystem do you mean "service" as in the ANTS profiler service or "service" as in the service we are running? I mean the service you are running. LocalSystem has the most rights of any user so it's guaranteed not to have a problem writing out profiler results anywhere and most services should run OK as this user. You could also configure it to run as your user if you have the log on as a service right granted. If you are profiling a network service there are some serious security concerns with doing this, so I can understand wanting to keep the service running as one of the users with fewer permissions. This is possible, but you'll need to create a new folder with the appropriate permissions and tell the profiler to use that instead. Here's how: * Create a new folder to store temporary profiler files in. It's probably easiest to put this in the root folder of a drive (I tried this out with a folder called 'D:\Profiler') * Grant full control permissions to this folder for the user you are running as and the user that the service runs as (generally Local Service or Network Service) * Set the RGTEMP environment variable to point at this folder before launching the profiler. You can do this by setting the variable then launching the profiler from the command line, or by editing the environment variables in the advanced tab of the System control panel and logging off and back on again. We don't grant these permissions automatically as it would cause a change to the security surface of the system - Local Service and Network Service processes are limited in what they can communicate with by design, and profiling requires a (slight) decrease in this security. This should work in all versions of the profiler, but I've just tried this on a version of 4.3 and seen it fail so you may wish to try the 5.0 beta version that's now available if you run into difficulties. You can download them from here: http://www.red-gate.com/messageboard/viewforum.php?f=92 / comments
gpeszek wrote: I am having the exact same issue: the UI is stuck in "Starting service" and there is no profiling. Andrew, when you say The cheapest way to get around it is to reconfigure the se...
0 votes
The service not showing up as running is odd. Normally ANTS will get an error back from the service controller when the service fails to start and will report this back to you. The status that ANTS is showing indicates that it has sent the start request, hasn't received an error and hasn't yet received a request to start profiling. An early crash generally gets reported back to the profiler as an error, and a later crash ought to happen after the profiler has connected so the UI status will have changed. There are a couple of cases where I know this can get stuck, but neither appear to apply here: * if the service is unmanaged, ANTS will stay at this screen until the first time it executes managed code (but the service should start with no problem) * if the service is managed but the profiler fails to load into the process, ANTS can't tell the difference from the first case and will stick at this screen as well. A 'failed to CoCreate profiler' message will be placed in the event log. * If the service starts up and then shuts down in an orderly manner without running any unmanaged code, ANTS might not notice it has gone away. The second case most commonly occurs with services when they don't have permission to read the profiler DLL, but doesn't stop the service from starting in all the cases I've seen. Can you profile successfully with the new memory profiler? Does the service process appear in task manager? It's possible it's stuck in some sort of limbo where it can't complete startup. Additionally, does it appear briefly and then disappear again? Do any errors or warnings appear in the system event log when ANTS tries to restart the service? ANTS puts a log file in the local app data directory (whose location varies on different editions of Windows: on XP these should be in Documents and Settings\<user>\Local Settings\Application Data\Red Gate\ANTS Performance Profiler 5). Are there any warnings or errors in there? Are you using a config file or security policy that could be violated by the profiler with your service? I'd expect that to produce an error, but I've never tried with a service. The profiler is an unmanaged DLL and might not be permitted to load at some trust levels, and line-level timing requires full trust. / comments
The service not showing up as running is odd. Normally ANTS will get an error back from the service controller when the service fails to start and will report this back to you. The status that ANTS...
0 votes
ANTS is at heart an instrumenting profiler, which is to say that it modifies the program(s) being profiled to contain extra code to measure timings and hit counts. This means that it captures a great deal of detail, but it will change the way your program runs. Usually this appears as a constant factor (and hence can be ignored in the results), but can become significant if two parts of the program that take similar amounts of run time get different amounts of instrumentation: for example, a part that calls a lot of functions vs one that calls very few: with the profiler attached the part that calls fewer functions will run more quickly. It does try to compensate for this: the nature of modern processors makes it impossible to completely accurately predict the way the code inserted by the profiler will behave, but the errors usually average out over long periods of time. This means that when you use the profiler, you might see the effects of the instrumentation causing the performance to change, but when you read the results this effect is compensated for. There is an option to turn this off if you want to see the raw results. There are still effects that can't be compensated for: in particular, the data the profiler produces will mean that there is less cache space available to the program being profiled, and the instrumentation will change the way instructions are scheduled by the processor. Usually these effects have a negligible impact on the performance compared to that of the instrumentation itself, but may be worth bearing in mind. You can reduce these effects by turning down the amount of detail captured by the profiler. The first thing to try is turning on function inlining in the options: inlined functions won't be instrumented and time used by functions that .NET inlines will be incorporated into their parent functions, so you will get less detail but more accurate results. The next thing to do is to try using one of the less detailed modes: turning off line-level timings or measuring the time spent in functions without source will reduce the amount of work the profiler has to do, and consequently the influence it has on the performance of the target application. / comments
ANTS is at heart an instrumenting profiler, which is to say that it modifies the program(s) being profiled to contain extra code to measure timings and hit counts. This means that it captures a gre...
0 votes
adamhill wrote: Second: How can I trace some generic allocated object like "byte[]" back to the object that actually allocated it? My specific question is/was a ImageBrush in WPF, but shows up in the object list as a byte[]. Is there anyway to say "Just show me all ImageBrushes and the external bytes that were allocated from them?" We're working on a couple of features to help with this: at least one of these should show up in the next EA build, so you will be able to find things like only the byte arrays that are referenced by ImageBrushes and explore how objects of different classes relate to each other. We're not currently planning to have a feature that will show the place an object was allocated in this version: we're focusing much more on providing ways of exploring how objects relate to each other at the time that a snapshot was taken - this is because one of the primary goals of the memory profiler is to find out why an object is in memory now. It's also because the way .NET allocates and uses objects means that often the thing that allocates an object and the thing that actually uses it are separated by a long distance, so this information can be distracting and misleading - as a trivial example, an object that is assigned via a property would be 'allocated' by the object that did the assigning, but would be kept in memory by the thing it was assigned to. One more such assignment would completely obfuscate what happened if you only look at where it was allocated. This is inevitable due to the way .NET is designed. In languages like C++ the need to free objects up when they are finished means that usually the class that creates an object is responsible for ensuring that it is destroyed. In .NET the garbage collector means that there's no need for anything to take responsibility for most objects, so they become free to wander far from where they were initially created. / comments
adamhill wrote: Second: How can I trace some generic allocated object like "byte[]" back to the object that actually allocated it? My specific question is/was a ImageBrush in WPF, but shows up in...
0 votes