How do automatically measure memory consumption during the tests in VisualStudio? - visual-studio

I have a lot of tests based on the Google Test framework.
All tests were built in Release mode, and when I manually run the separate test under the "Visual Studio" on "Diagnostic Tool Window" (Ctrl+Alt+F2) in the "Process Memory" chart I can see the maximum heap memory consumption.
Is there exist way, to log memory consumption automatically for each running test?
All I need to know is the maximum amount of memory that each test used during the execution.

Related

Intel parallel studio warning on VS2005

I installed the intel parallel studio and used it. But when I ran the application, I got a message in the Output section of Visual Studio 2005 that said
“Data collection has stopped after reaching the configured limit of 10
MB of raw data. The target will continue to run, but no further data
will be collected. The data collection stopped since the data size
limit of (10 Mb) is reached. The application is running but no data is
collected.”
Does anyone has any idea why this message is coming and is it like if I continue running my application the data will not be collected. I am not sure how to configure the settings as this is the first time I am using any such tool for finding performance hotspots.
It would be nice to know what version of Parallel Studio you are using and which collection you are running (since different collector use different settings).
Assuming you are running Amplifier collection:
Click "Project Properties" button (on toolbar or under "Start" button on left side panel).
In "Target" tab expand "Advanced" section.
There is "Collection data limit" option. You could increase it as appropriate. In latest versions of Parallel Studio it is increased to 500 MB by default.
You could set data limit to zero for unlimited collection. I don't recommend this since you may run out of disc space quickly. This is also the reason why this option is here - unlimited collection produce huge amounts of raw data.

How can I fix launch time performance and suspend performance in WACK report?

I tested my app with WACK and I got the following result. How can I solve these two warnings, and can I put my app in the AppStore?
------------------------------------------------------------------
Overall Score: PASSED WITH WARNINGS
Launch time performance
WARNING
Performance Launch
Warning: Following results were encountered while running the Performance Launch test.
Application App has a launch time of 0.971 secs.
Application App has CPU utilization of 12.15 percent. CPU utilization of 50 percent or higher can significantly degrade performance for Application Launch/Suspend.
Application App allocates process private memory of 0 MB. Process private memory usage of greater than 25 MB can significantly degrade performance for Application Launch/Suspend.
Application App issues File I/O of 0.722 MB. Issuing File I/O of 50 MB or higher can significantly degrade performance for Application Launch/Suspend.
Impact if not fixed: Application launch is your customer’s first experience and impression of your Metro style application. To ensure system responsiveness applications are expected to launch within 5 seconds. Windows 8 is targeted at a broad range of hardware configurations and this launch time target is intended to provide a good baseline of performance across the broadest range of hardware capabilities. It is important to understand the launch performance of your application, while taking hardware capabilities into consideration. If your application has passed this test locally but has launch times which are close to the required limits, consider what type of hardware this test is being executed on as your application could potentially fail the Windows Store certification process. Reducing resource utilization can reduce the duration of launch, especially when contention for resources is high.
How to fix: Additional information can be found here.
Suspend performance
WARNING
Performance Suspend
Warning: Following results were encountered while running the Performance Suspend test.
Application App has a suspend time of 0.005 secs.
Application App has CPU utilization of 9.11 percent. CPU utilization of 50 percent or higher can significantly degrade performance for Application Launch/Suspend.
Application App issues File I/O of 0 MB. Issuing File I/O of 20 MB or higher can significantly degrade performance for Application Launch/Suspend.
Impact if not fixed: In the Metro style user experience, Application suspend is a very frequent occurrence. To ensure fast and fluid multitasking, applications are expected to suspend within 2 seconds. Windows 8 is targeted at a broad range of hardware configurations and this suspend time target is intended to provide a good baseline of performance across the broadest range of hardware capabilities. It is important to understand the suspend performance of your application, while taking hardware capabilities into consideration. If your application has passed this test locally but has suspend times which are close to the required limits, consider what type of hardware this test is being executed on as your application could potentially fail the Windows Store certification process. Reducing resource utilization during can improve the duration of suspend, especially when contention for resources is high.
How to fix: Additional information can be found here.
Every app gets those warnings in Consumer Preview, as they are used to report the startup and suspend times. You'll see that your numbers are well below the threshold of concern. These warnings won't cause a problem with the Store--every app you see in the Store today got those warnings too.

Reclaim Memory in Intellij Idea

I have an heap size of 1GB for my Intellij. I would prefer not to increase it further. I have noticed that the Memory Used by the IDE progressively increases after each run of an particularly heavy Junit Test case. After it hits the upper limit, I had to restart the IDE. Performing GC does not work.
Could this be related to my code? Or is there a way to reclaim memory in Intellij.
Edit: I have more information about it now. It seems that the memory is not reclaimed from the Junit thread, if the thread is interrupted (by pressing the red button to stop the test) or if it fails because of an exception. I will do more memory profiling and submit a bug report.
Your code should not affect an IDE. If you are right, it looks like a bug, a memory leak. You should report it in Jetbrains.

GPU code gives different time when run from VS2008 and when running only .exe

I have cuda events in my code to record the time of execution. When I click "Start Debuggin" from VS 2008, the timer gives a value of 1.5 seconds. However, when I run the program from .exe file, it gives time of .4 seconds. Why this difference?
There's no inherent reason that running attached to the debugger should introduce a performance difference, other than (just a few possibilities):
Do you have any conditional breakpoints set? Depending on the condition, these can have a dramatic impact on execution time.
Are you explicitly writing large amounts of data to the Debug or Trace listeners? (Edit: that's relevant for C#, probably not for C++.)
Is the EXE compiled in Release mode? By default, the Release config turns on optimizations that aren't present when building in Debug mode.
Is your timing code really only timing the relevant section? If you're starting the timer at the start of program execution instead of around the GPU calls that you're really interested in, you may be accidentally timing some startup tasks that are tied to running with the debugger that won't be active in a standalone app.

Accessing Windows (XP) performance counters preferably in VBScript

I'm testing a web application for browser memory leaks using Quick Test Professional (QTP) 9.5 and Internet Explorer 6. PerfMon works for monitoring the memory usage over time, but its data has to be synchronized to the testing results to find out which steps trigger the browser memory leak. Since QTP's scripting language is VBScript, how can I get particular performance counters (in this case the "Private Bytes" in process "IExplore.exe")?
Don’t Panic: You Can Use Scripts to Monitor Performance. Sorry about the previous line. This is the name of the article.

Resources