Taking a snapshot of a COM+ server in production

albelalbel Posts: 7
Hi,
I am evaluating the Ants Profiler 3 (3.1.0.20) product and am having a problem taking a snapshot in a production situation.
Here is the scenario:
I am profiling memory usage of a COM+ server that's written in C#. All code is compiled in 32 bit. When I run a profile session in the development debug environment (Win XP Pro - SP2) I take a snapshot and successfully get memory usage results. However, when I profile the COM+ component in a production release environment (Win 2003 Server - SP 1 - MS virtual machine) I get the following error message:

"The COM+ Svc has not loaded the .NET Framework. Please check that Svc is a .NET application or one that hosts the Common Language Runtime. Please note that the COM+ application will not be loaded until the client application accesses it."

... and there are no results in the profiler.

In the production environment Ants Profiler 3 launches the client application and it runs successfully to completion, entering data to a database using the COM+ component. The Windows events logs contain no entries related to my client application or the Ants Profiler. Is there an Ants Profiler log that can help reveal what is causing this problem?

Thanks in advance for any help.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    Thanks for asking... If the profiler is able to get results from memory profiling, but not for performance, then you may want to try the 'profile all methods' setting as opposed to the default 'profile methods that contain source code' option. What's probably happening is that you are profiling a release build of the serviced component and there is no program database (pdb file) that would normally be used to locate source code for your component. Building the component as a debug and copying the pdb into the same folder as the dll would get Profiler working fully to provide filtering for your own methods only as well as enabling the line-level timings in the source code view.

    Hopefully this helps!
  • Hi,
    I am trying to profile the memory usage of the production version of a COM+ component on a production machine. I am not really interested in the performance profile of the COM+ component. The error message reported by Ants Profiler 3, the "The COM+ Svc has not loaded the .NET Framework. Please check that Svc is a .NET application..." message included in my earlier post, is generated when I try a memory profile session with Ants Profiler 3.
    I guess my next question is: do I need a debug version of the COM+ component to get memory profile results with Ants Profiler 3?

    Regards,

    albel
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello Albel,

    You should still be able to get memory profiling results from the release build, you will be missing some information such as the source code location and the souce code window will be empty.

    I can't readily explain this -- I'd assume that the COM+ application had crashed. Have you checked the server application logs for errors?
  • Hi,
    Two observations suggest the COM+ component didn't crash:
    - The application that calls the COM component ran to completion, using the COM component during database processing. If the COM component didn't work, nothing would have been written to the database (3000 records were written).
    - There were no Application or System Events in the Event viewer related to either Ants Profiler, or my application.

    Does Ants Profiler 3 itself have any logging mechanism that could shed more light on any problems it has during a memory profile session?

    Regards,

    albel
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    Sure -- create a logs folder underneath the ANTS Profiler 3 folder. This will make ANTS Profiler log all of its' actions.

    Please let us know what you find!
  • Hi,
    I have been trying to get Ants to attach to the COM+ service to see its memory. I tried a few other approaches that did not work.
    Does this log file tell you which direction to go to get the service to load the .Net framework when its is run in conjunction with Ants 3? Let me also know if there is a way to get more verbose logging from Ants Profiler 3.

    Below is output in the log that it creates on the production virtual machine.

    Regards,

    1/11/2008 3:44:24 PM ANTSProfilerLog initialized
    1/11/2008 3:44:24 PM PID = 4044
    1/11/2008 3:44:24 PM Log file name = ANTSProfilerLog4044.txt
    1/11/2008 3:44:24 PM OS version = Microsoft Windows NT 5.1.2600 Service Pack 2
    1/11/2008 3:44:24 PM Machine name = ABELINSKAS-IBM
    1/11/2008 3:44:24 PM User name = abelinskas
    1/11/2008 3:44:24 PM PARAMHOST - Listening on port 8084
    1/11/2008 3:44:24 PM PARAMHOST - Listening on port 8084, channel registered
    1/11/2008 3:44:26 PM EditProjectClosingWizard start
    1/11/2008 3:44:26 PM EditProjectClosingWizard start
    1/11/2008 3:44:26 PM About to show wizard
    1/11/2008 3:44:42 PM Wizard dialog returned
    1/11/2008 3:44:46 PM UI Start profiling
    1/11/2008 3:44:46 PM ENGINE - Core2.dll found in regisry
    1/11/2008 3:44:54 PM ENGINE Start profiling memory of COM+ application IdpSvc
    1/11/2008 3:44:54 PM ENGINE The profiler is enabled
    1/11/2008 3:44:54 PM TRANSFER - Waiting for pipe connection from core
    1/11/2008 3:45:51 PM UI Take snapshot
    1/11/2008 3:45:51 PM ENGINE Start get memory results
    1/11/2008 3:45:51 PM TRANSFER - Not connected so returning last set of results
    1/11/2008 3:46:58 PM UI Stop profiling
    1/11/2008 3:46:58 PM ENGINE Stopping profiler
    1/11/2008 3:46:58 PM ENGINE Closing profiling session
    1/11/2008 4:11:42 PM ENGINE Closing profiling session
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    The most likely explanation for what is in the log is that the COM+ application did not load the .NET runtime. When a process loads the runtime, it connects to ANTS Profiler through a named pipe; the log indicates this didn't happen.

    I'd guess that the application didn't load any .NET code, or no .NET code had been invoked. In the latter case you need to run whatever application actually uses the COM+ application and get it to invoke some managed methods in the COM+ application.
  • Hi,
    Ants starts the client app. (which makes the request to the COM+ component - which gets it to load the .NET modules) in the debug environment and will produce results in Ants there. But using the same procedure to run a memory allocation profile in the release environment produces the log file shown in the earlier reply and the error about not having loaded the .NET runtime.
    The COM+ service is listed in Ants and I select it, and I browse to the installed client, but after executing some of the client functionality, the results are not gathered.
    Should I run the client app manually rather than let Ants do it? Or is there another way to start a client that uses a COM+ server?

    regards,
    albel
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I don't think it matters how the application that calls the COM+ app is started. Just to check, the COM+ application is configured as a server application rather than a library application? ANTS Profiler can't profile Library applications.
  • This COM+ server is not one .Exe file. It is a collection of .Dlls that run under DllHost.exe. Under the Windows component services activation properties, this server is identified as a COM+ application. Many of these Dlls are loaded dynamically on demand. Can Ants Profiler track the memory of a unit of components such as this?[/img]
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Yes -- it uses .NET's Process.start to spawn dllhost.exe and load the COM+ dll in its' own process. ANTS Profiler then gets statistics about the whole process.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    It could also be related to this issue -- you can't profile com+ over a terminal services/remote desktop session.

    http://www.red-gate.com/support/kb/KB200711000200.htm
Sign In or Register to comment.