Memory profiling on Visual studio 2012 PRF0025 error - visual-studio-2012

I implemented big program to find nearest neighbor using kd-Tree. But when I test it, used memory is bigger and bigger. I tried this advice, bud still not working. (No data collected when profiling .NET class library with Visual Studio 2012)
output of profiler:
Profiling started.
Warning VSP2355: Some Windows counters will not be collected. Without this data, some performance rules may not fire.
Profiling process ID 10112 (KdTreeNN).
Process ID 10112 has exited.
Data written to C:\<path>\KdTreeNN\KdTreeNN140529.vsp.
Profiling finished.
PRF0025: No data was collected.
Profiling complete.
Some other advices? Please help. Thanks

Related

What is the purpose of 'Captures' tab in Android Studio 2.3.3?

I had noted a new tab 'Captures' on the left side of the Android Studio 2.3.3.
For me it is seem to be empty.
What is Captures meant for?
Please refer the documentation explaining on Captures in Android Studio.
When you're monitoring memory usage in the Memory Monitor included in Android Monitor you can, at the same time, dump a snapshot of the Java heap to an Android-specific Heap/CPU Profiling (HPROF) file. The HPROF Viewer displays classes, instances of each class, and a reference tree to help you track memory usage and find memory leaks. HPROF is a binary heap dump format originally supported by J2SE.
After you do a heap dump, Android Studio automatically stores it so you can view it again. "Captures" is where you see these saved HPROF dumps.
You can also see captured view layout etc there as well.
There isn't an answer to this in the built-in help. However, according to the release notes from 2015, it is a "view which shows the various performance data files you've collected".
You can learn more about Captures in the documentation about HPROF.

Android Studio IDE performance very slow

With one project open the IDE runs smoothly but once I open two the IDE runs painfully slow. I'm suspecting a memory issue.
I'm running an i7 2015 mbp with 16gb of memory. How can I up the amount of resources android studio is allowed to use to the point where two projects open won't lag?
I've already updated -xmx=2048 -XX:MaxPermSize=512m via Why Android Studio is slowing down when editing xml file or changing the design?
studio.vmoptions
-Xms256m
-Xmx2048m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=225m
-XX:+UseCompressedOops
Modifying the properties the way I did is the first step.
The second step is not to touch Android Studio AT ALL until it is done processing. If you wait for all processes to complete (roughly 20 seconds) then it runs like it is supposed to.
It seems as though Android Studio's performance slows if you try using it when ANY processing is going on ie. if you wait for the first 20 seconds you're good to go but if it starts processing again for any other reason you have to wait until it's finished or you'll make the app lag quite badly for an indefinite period of time. This sounds like a bug that has nothing to do with memory available. In the meantime we'll just have to skirt around it...
** EDIT **
It seems as though the performance slowly crawls back if you lose it. Almost like a slow garbage collection. Restarting Android Studio when performance is poor is the only "fast track" I've found to getting around this bug.

What is the best way to trace down memory leaks

In a huge C++ builder 2010 application with several DLL's being built and linked etc. What would be the best way to trace down memory leaks that accumulate over a long period of time? Say that the application has to be running for a week or something on the target machine before it becomes an issue. Let's assume that there is no profiling application available like AQ Time or something similar. Just using the standard IDE and perhaps some code.
My initial idea was to write a macro to use in all classes that keeps track of the number of instances and space used of each class type to start with.
The RTL uses FastMM as its memory manager. FastMM supports memory leak reporting and tracing. The native version of FastMM that is included in the RTL is a stripped down version, but it does support minimal leak reporting. You can set the RTL's global ReportMemoryLeaksOnShutdown variable to true at run-time and FastMM will generate a basic leak report when the app is closed. For more advanced usage, you can download the full version of FastMM and add it to your app, which will replace the RTL's native version. You can then configure FastMM as desired.

CUDA: Nsight VS2010 profile __device__ function

I would like to know how to profile a __device__ function which is inside a __global__ function with Nsight 2.2 on visual studio 2010. I need to know which function is consuming a lot of resources and time. I have CUDA 5.0 on CC 2.0.
Nsight Visual Studio Edition 3.0 CUDA Profiler introduces source correlated experiments. The Profile CUDA Activity supports the following source level experiments:
Instruction Count - Collects instructions executed, thread instructions executed, active thread histogram, predicated thread histogram for every user instruction in the kernel. Information on syscalls (printf) is not collected.
Divergent Branch - Collects branch taken, branch not taken, and divergence count for flow control instructions.
Memory Transactions - Collects transaction counts, ideal transaction counter, and requested bytes for global, local, and shared memory instructions.
This information is collected per SASS instruction. If the kernel is compiled with -lineinfo (--generate-line-info) the information can be rolled up to PTX and high level source code. Since this data is rolled up from SASS some statistics may not be intuitive to the high level source. For example a branch statistic may show 100% not taken when you expected 100% taken. If you look at the SASS code you may see that the compiler reversed the conditional.
Please also not that on optimized builds the compiler is sometimes unable to maintain line table information.
At this time hardware performance counters and timing is only available at the kernel level.
Device code timing can be done using clock() and clock64() as mentioned in comments. This is a very advanced technique which requires both ability to understand SASS and interpret results with respect to the SM warp schedulers.

Run-time errors and memory leaks detection

Created application is working toooo slow, looks like there are a lot of memory leaks, there are a lot of pointers. So, please, can you advice some effective tool for run-time errors and memory leaks detection in Visual Studio C++?
You can use deleaker. It must help you.
I know 2 good tools for windows: Purify and Insure++.
For linux: Valgrind.
If you use the debug version of the CRT library , you can use find all memory leaks very easily.
Basically after including appropriate headers you call
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
somewhere in the beginning of you program.
Before the program exits you should call
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG );
Which dumps all the memory leaks to Debug Output Window.
But the application being slow might be unrelated to memory leaks, For performance profiling you can follow directions as per Find Application Bottlenecks with Visual Studio Profiler
For catching bad C++ constructs at compile time, you can use the static code analysis feature of Visual Studio 2010 or later.

Resources