locked
Wrong report data: memory instead of CPU and vice-versa RRS feed

  • Question

  • Hello,

    I've been fighting with VS 2010 SP1 for a while. I have a Silverlight project that is hosted in a web application run under IIS 7. I try to profile the web project and collect CPU usage samples. The profiler runs successfully, but when I open the result .vsp file in the VS, it analyzes it and renders a memory usage report without any data on CPU usage. I've tried to switch the performance session to Sampling, Instrumentation, Memory allocation sampling, but in any case I get a memory usage report instead of CPU usage report. Running the command-line VSPerfReport gives similar reults with only memory allocation data.

    If CPU Sampling is selected, the VSPerfMon is started by VS with the following command arguments

    -output:"<xxx>.vsp"
    -SAMPLE
    -WINCOUNTER:"\Processor(_Total)\% Processor Time"
    -WINCOUNTER:"!\.NET CLR Exceptions(%s)\# of Exceps Thrown / sec"
    -WINCOUNTER:"\Memory\Pages/sec"
    -WINCOUNTER:"!\.NET CLR Memory(%s)\# Bytes in all Heaps"
    -WINCOUNTER:"!\.NET CLR Memory(%s)\# Total committed bytes"
    -WINCOUNTER:"!\.NET CLR Memory(%s)\# Gen 0 Collections"
    -WINCOUNTER:"!\.NET CLR Memory(%s)\# Gen 1 Collections"
    -WINCOUNTER:"!\.NET CLR Memory(%s)\# Gen 2 Collections"
    -WINCOUNTER:"!\.NET CLR Memory(%s)\%% Time in GC"
    -WINCOUNTER:"\Processor(_Total)\% Privileged Time"
    -WINCOUNTER:"\Processor(_Total)\% User Time"
    -WINCOUNTER:"!\Process(%s)\%% Processor Time"
    -WINCOUNTER:"!\Process(%s)\%% Privileged Time"
    -WINCOUNTER:"!\Process(%s)\%% User Time"
    -WINCOUNTER:"!\Process(%s)\Private Bytes"
    -WINCOUNTER:"!\.NET CLR LocksAndThreads(%s)\Contention Rate / sec"
    -WINCOUNTER:"!\Process(%s)\Working Set"
    -AUTOMARK:500
    -USER:"IIS APPPOOL\ASP.NET v4.0"
    -CS
    I've tried to use an experimental instance of VS (with the help of VS 2010 SP1 SDK), but the result is the same.

     

    Please, help identify and fix the issue. Working without profiler is pain.

     

    Update: When I tried to profile the Silverlight application that is hosted in the web app and I needed memory allocation results, VS rendered CPU usage report.

    Seems like some issues with environment, but I don't know how to diagnose them.


    Thursday, July 7, 2011 9:04 AM

All replies

  • Thank you for your post, we're investigating on this issue, it might take some time before back to  you.


    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, July 11, 2011 5:54 AM
  • I have similar issue, the Visual Studio always generates memory profiling report instead of selected one (eg. cpu report).

    Visual Studio 2010 SP1, Windows 7 SP1 x86

    Hint: VSPerfMon.exe and immediately after devenv.exe crashed when I selected memory profiling first time. From this time, it always profiles memory. I tried everything, restarting, deleting of profiler files,...

     

    From Windows logs:

    Log Name:      Application

    Source:        Application Error

    Date:          2011-07-11 13:34:56

    Event ID:      1000

    Task Category: (100)

    Level:         Error

    Keywords:      Classic

    User:          N/A

    Computer:      Trojan

    Description:

    Faulting application name: VSPerfMon.exe, version: 10.0.40219.1, time stamp: 0x4d5f3cda

    Faulting module name: VSPerfMon.exe, version: 10.0.40219.1, time stamp: 0x4d5f3cda

    Exception code: 0xc0000005

    Fault offset: 0x0001a6e2

    Faulting process id: 0x1748

    Faulting application start time: 0x01cc3fbcae396564

    Faulting application path: C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Performance Tools\VSPerfMon.exe

    Faulting module path: C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Performance Tools\VSPerfMon.exe

    Report Id: cd0e845e-abb1-11e0-895f-005056c00008

    Event Xml:

    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

      <System>

        <Provider Name="Application Error" />

        <EventID Qualifiers="0">1000</EventID>

        <Level>2</Level>

        <Task>100</Task>

        <Keywords>0x80000000000000</Keywords>

        <TimeCreated SystemTime="2011-07-11T11:34:56.000000000Z" />

        <EventRecordID>14124</EventRecordID>

        <Channel>Application</Channel>

        <Computer>Trojan</Computer>

        <Security />

      </System>

      <EventData>

        <Data>VSPerfMon.exe</Data>

        <Data>10.0.40219.1</Data>

        <Data>4d5f3cda</Data>

        <Data>VSPerfMon.exe</Data>

        <Data>10.0.40219.1</Data>

        <Data>4d5f3cda</Data>

        <Data>c0000005</Data>

        <Data>0001a6e2</Data>

        <Data>1748</Data>

        <Data>01cc3fbcae396564</Data>

        <Data>C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Performance Tools\VSPerfMon.exe</Data>

        <Data>C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Performance Tools\VSPerfMon.exe</Data>

        <Data>cd0e845e-abb1-11e0-895f-005056c00008</Data>

      </EventData>

    </Event>

     

     

     

    See attached VS stack trace, which occures sometimes when I try to load performance report generated by crashed VSPerfMon:

     

    Log Name:      Application

    Source:        .NET Runtime

    Date:          2011-07-12 16:13:40

    Event ID:      1026

    Task Category: None

    Level:         Error

    Keywords:      Classic

    User:          N/A

    Computer:      Trojan

    Description:

    Application: devenv.exe

    Framework Version: v4.0.30319

    Description: The process was terminated due to an unhandled exception.

    Exception Info: System.AccessViolationException

    Stack:

       at <Module>.MSITSDI.CMSITSDI.LookupManagedCodeRange(MSITSDI.CMSITSDI*, _GUID*, UInt32, UInt32, UInt32*, UInt32*, UInt32*, UInt32*)

       at VSPerfReader.Symbols.GetManagedCodeRange(System.ValueType, UInt32, UInt32)

       at VSPerfReader.LineAnalysis.CodeRangeFromSample(VSPerfReader.SampleInfo, Boolean)

       at VSPerfReader.LineAnalysis.AddLineSample(VSPerfReader.SampleInfo, VSPerfReader.CallTreeNodeSampling, Boolean)

       at VSPerfReader.CallTreeSampling.PushingOnToStack(VSPerfReader.CallTreeNode, VSPerfReader.SampleInfo)

       at VSPerfReader.CallTreeSampling.AddStack(System.Collections.Generic.IEnumerable`1<UInt64>, UInt64, VSPerfReader.ProcessInfo, UInt64, Boolean)

       at VSPerfReader.SampleEventDecoder.ProcessAllocationStack<_ALLOCATIONEVENT32>(VSPerfReader.ProcessInfo, UInt64, UInt64[], _ALLOCATIONEVENT32*)

       at VSPerfReader.SampleEventDecoder.SampleEventHandlerFn(System.Object, VSPerfReader.PerfEventArgs)

       at VSPerfReader.BlockDecoder.raise_OnNewEvent(System.Object, VSPerfReader.PerfEventArgs)

       at VSPerfReader.BlockDecoder.PerfBlockHandler(System.Object, VSPerfReader.BlockEventArgs)

       at VSPerfReader.BlockReader.Read()

       at VSPerfAnalysis.VspDBCommand.BuildCallTrees()

       at VSPerfAnalysis.ProfileDBCommand.Analyze()

       at VSPerfPresentation.ProfileDataProvider.ChainedAnalyze()

       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr, System.Object[], System.Object, Int32, Boolean, System.Object[] ByRef)

       at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)

       at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.DoAsyncCall()

       at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(System.Object)

       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)

       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()

       at System.Threading.ThreadPoolWorkQueue.Dispatch()

       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

     

    Event Xml:

    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

      <System>

        <Provider Name=".NET Runtime" />

        <EventID Qualifiers="0">1026</EventID>

        <Level>2</Level>

        <Task>0</Task>

        <Keywords>0x80000000000000</Keywords>

        <TimeCreated SystemTime="2011-07-12T14:13:40.000000000Z" />

        <EventRecordID>14248</EventRecordID>

        <Channel>Application</Channel>

        <Computer>Trojan</Computer>

        <Security />

      </System>

      <EventData>

        <Data>Application: devenv.exe

    Framework Version: v4.0.30319

    Description: The process was terminated due to an unhandled exception.

    Exception Info: System.AccessViolationException

    Stack:

       at &lt;Module&gt;.MSITSDI.CMSITSDI.LookupManagedCodeRange(MSITSDI.CMSITSDI*, _GUID*, UInt32, UInt32, UInt32*, UInt32*, UInt32*, UInt32*)

       at VSPerfReader.Symbols.GetManagedCodeRange(System.ValueType, UInt32, UInt32)

       at VSPerfReader.LineAnalysis.CodeRangeFromSample(VSPerfReader.SampleInfo, Boolean)

       at VSPerfReader.LineAnalysis.AddLineSample(VSPerfReader.SampleInfo, VSPerfReader.CallTreeNodeSampling, Boolean)

       at VSPerfReader.CallTreeSampling.PushingOnToStack(VSPerfReader.CallTreeNode, VSPerfReader.SampleInfo)

       at VSPerfReader.CallTreeSampling.AddStack(System.Collections.Generic.IEnumerable`1&lt;UInt64&gt;, UInt64, VSPerfReader.ProcessInfo, UInt64, Boolean)

       at VSPerfReader.SampleEventDecoder.ProcessAllocationStack&lt;_ALLOCATIONEVENT32&gt;(VSPerfReader.ProcessInfo, UInt64, UInt64[], _ALLOCATIONEVENT32*)

       at VSPerfReader.SampleEventDecoder.SampleEventHandlerFn(System.Object, VSPerfReader.PerfEventArgs)

       at VSPerfReader.BlockDecoder.raise_OnNewEvent(System.Object, VSPerfReader.PerfEventArgs)

       at VSPerfReader.BlockDecoder.PerfBlockHandler(System.Object, VSPerfReader.BlockEventArgs)

       at VSPerfReader.BlockReader.Read()

       at VSPerfAnalysis.VspDBCommand.BuildCallTrees()

       at VSPerfAnalysis.ProfileDBCommand.Analyze()

       at VSPerfPresentation.ProfileDataProvider.ChainedAnalyze()

       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr, System.Object[], System.Object, Int32, Boolean, System.Object[] ByRef)

       at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)

       at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.DoAsyncCall()

       at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(System.Object)

       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)

       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()

       at System.Threading.ThreadPoolWorkQueue.Dispatch()

       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

    </Data>

      </EventData>

    </Event>

     

     

     

    Tuesday, July 12, 2011 2:39 PM
  • Hint: VSPerfMon.exe and immediately after devenv.exe crashed when I selected memory profiling first time. From this time, it always profiles memory. I tried everything, restarting, deleting of profiler files,...

    I remember that my issues also began after a crash during profiling (seems like it was first attempt of memory profiling as well). Although I can't give exact details and cannot find related messages in the log.
    Thursday, July 14, 2011 4:58 AM
  • Hi Pavel,

    Does this issue consistently occur on all projects or just that specific Silverlight project? Have you tried reinstall profiler (http://www.microsoft.com/download/en/details.aspx?id=23205)?

    Thanks & Regards,
    Leon Zhang
    Microsoft Online Community Support

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, July 21, 2011 2:43 AM
  • Hi Leon,

    Does this issue consistently occur on all projects or just that specific Silverlight project?

    As I've written above, I have a Web Application project that always gives me a Memory report and a Silverlight project that always gives a CPU report. If you ment this, these are two different projects, although they are in the same solution and are somehow related to each other.

    I've just tried to create a new solution with default Silverlight project template (Silverlight application + Web application) and test the profiler on it. In this case, the web application is hosted on Cassini instead of IIS. I used the wizard and created a CPU sampling session against the web application. When I started profiling, it first asked Administrator priviledges (the message said it couldn't access the profiler driver). When I stopped the session, VS rendered Memory profiling report (instead of CPU). So, the results coincide between my real solution and a clean one.

    Should I do some other tests, probably with other project types?

    Have you tried reinstall profiler (http://www.microsoft.com/download/en/details.aspx?id=23205)?

    No, I haven't. I will do when I have time to dive into the problem again and if there are no other workarounds.

    Thursday, July 21, 2011 5:31 AM
  • OK, I have installed the x64 profiler package (it was new installation, not reinstallation - I had not got the standalone package installed earlier). It didn't help.

     

    Then I tried to switch to Concurrency profiling (just trying to change bad settings stored somewhere). After the profiling was finished, VS showed the following error:

    Error VSP1713: Incompatible collection settings for C:\Projects\Allegro\Source Code\HSI+Main-Root\AWDB.SL\AWDB110722(3).vsp. Cannot collect memory and concurrency data at the same time.PRF0025: No data was collected.

     

    Several settings in environment are definitely incorrect...

    Friday, July 22, 2011 2:44 PM
  • An issue has been reported that seems similar: http://social.msdn.microsoft.com/Forums/en/vstsprofiler/thread/d42a22ea-ce41-4e86-a9c1-6f1e34fabe08

    As time passes, I've tried to reinstall the x64 profiler package - no luck.

    I've found several environment variables that were related to profiling (starting with COR_) and removed them. Even after reboot that didn't help.

    I've tried to use VSPerfCLREnv.cmd to switch the variables: enabled simple and global gclife modes, then turned all of them off several times. Again, no luck.

     

    I don't want to reinstall the neither VS nor the OS. I do need the profiler working.

    Are there any diagnostic procedures I might carry out to help find the reason of the problem?

    Monday, July 25, 2011 7:05 AM
  • It is hard to guess what exactly happen without a repro.

    Another thing we can try is to reset VS to default settings (http://msdn.microsoft.com/en-US/library/ms241273(v=VS.80).aspx) or launch VS in safe mode (http://msdn.microsoft.com/en-us/library/xee0c8y7(v=vs.80).aspx ). Though I doubt it helps.

    Thanks & Regards,
    Leon Zhang
    Microsoft Online Community Support


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Tuesday, July 26, 2011 8:26 AM
  • I'm experiencing the same problem, and it's a royal pain.  Rendering one of the most valuable features of the more expensive VS SKU's useless is not a great way to elicit customer "delight".  I suspect this is a widespread problem in a not-so-widespread feature.
    Wednesday, August 31, 2011 6:13 PM
  • Anyone get this solved?   I first had this issue, now I'm experiencing the lovely VS crash when doing an analysis of a vsp.

    Really not feeling warm and fuzzy at the moment ...

    Friday, November 18, 2011 9:09 PM
  • Anyone get this solved?   I first had this issue, now I'm experiencing the lovely VS crash when doing an analysis of a vsp.

    Really not feeling warm and fuzzy at the moment ...

    Here's the info from the VisualStudio crash dialog box:

    Problem signature:

      Problem Event Name: CLR20r3

      Problem Signature 01: devenv.exe

      Problem Signature 02: 10.0.40219.1

      Problem Signature 03: 4d5f2a73

      Problem Signature 04: Microsoft.VisualStudio.VirtualTreeGrid

      Problem Signature 05: 10.0.0.0

      Problem Signature 06: 4ba217f0

      Problem Signature 07: 425

      Problem Signature 08: 43

      Problem Signature 09: System.ArgumentException

      OS Version: 6.1.7601.2.1.0.256.4

      Locale ID: 1033

     

    Additional information about the problem:

      LCID: 1033

    Friday, November 18, 2011 9:33 PM
  • Same here, any fix?

    This issue was also reported:

    http://social.msdn.microsoft.com/Search/en-US?query=Error%20VSP1713%20performance&ac=8

    Tuesday, November 13, 2012 6:35 PM