How to track memory leaks using codeduitests? - coded-ui-tests

I have coded ui tests for standalone application. I think that we have memory leaks.
Does anybody have any ideas how to catch this using coded ui?
I know that we don't have any build-in feature to do this but maybe somebody faced the same problem before...

Doubtful that you can effectively find everything without hand-coding. Very simplified scenario - open and close one form for thousand times(suppose we talk about winforms) and hoping to get outofmemory, already requires cycle to call some automated script thousand times. Not to speak of more sophisticated scenarios - forcing garbage collection after each closing.

Coded ui tests is not the right tool for finding memory leaks.
You need to run profiling tools to identify memory leaks. You can use the visual studio profiler or other tools like ANTs Or .Net memory profiler (http://memprofiler.com/)

Related

Is it possible to profile only a plugin shared library without impacting main program?

Is it possible to profile only a shared library without looking the main program ?
For example, I developed a plugin and I would like to profile but with no need to profile the whole application. I just want to see the bottleneck of my plugin. (Of course, I would like to profile it while the main application is running and has loaded my plugin...)
I'm working on linux and I'm used to callgrind, but for the curiosity, I'm also interested by the possibilities on all systems, so I let the question general.
I'm interested in this because the main program is quite slow, and don't want to add the overhead of profiling on since I'm not interested by the main program performance here...
In Linux perf statistical profiling tool has very low overhead (1-2%), so you can profile entire application with perf record ./your_application and then analyze generated profile perf.data with perf report command. You may filter perf report output to some shared libraries or search function names of your plugin. Read more at http://www.brendangregg.com/perf.html
Callgrind is not just a profiler, it is binary recompiler used to implement exact profiler with instrumentation approach and it has 10-20 times overhead for any code, even when profiling tool is not enabled.
Your plugin only runs during certain times, right? Like when the user requests certain activities? People use this method with any IDE, manually pausing during that time. The pause will land in the plugin according to how much time it uses. Before you pause there is no performance impact because the app runs full speed, while in the pause, it is stopped, which you don't care because you're diagnosing your plugin.

System.OutOfMemoryException error

We are working on a rich client application in which many threads are running as well third party controls are used, after running application for 1 hour it starts giving error of 'System.OutOfMemoryException' unless and until we restart the application, i have search many sites for help but no particular and specified reason is giving.
Thanks.
It sounds pretty self-explanatory, you're system doesn't have enough memory. If you're still running the application as 32-bit then moving to 64-bit might solve the problem. I had exactly that problem on a server-2008-r2 recently, and moving to 64 bit did solve my problem. But if you're already 64 bit then perhaps the server doesn't have enough physical memory. In which case, you need to add more memory, or work out how to make your application less memory hungry. There could be objects that could be discarded that it's keeping references to, etc, and if that's the case you should try profiling to try and identify what's hogging the most memory. Beyond that, does the application use any unmanaged DLLs, e.g. COM objects written in C++ or similar. Maybe there's a memory leak outside of the managed framework?
I recommend using a profiler to identify and find where does the high memory consumption come from.

How to use IntelliTrace Standalone Collector to detect memory leaks in production .Net applications?

Visual Studio 2012RC has the ability to use externally collected trace files of IIS app pool data collected by the IntellitTrace Standalone Collector. I know that in my production app there is some kind of memory leak that is apparent after a few hours of monitoring.
I now have my large iTrace file ready to plug into VS2012, but would like to know how to find the questionable object.
I am also in the process of using the Debugger tools and following these instructions. However, run into an error indicating that the appropriate CLR files (or something like that) are not loaded when trying to do the .load SOS or any other command.
I was hoping to see a similar address list and consumed memory in the IntelliTrace analyzer - is this possible?
Some assistance would be appreciated.
Intellitrace only profiles events and method calls. You won't get information on individual objects or memory leaks because it's not tracking memory. There's also no event provided for object creation/destruction so you can't infer that in any case.
To track memory you will have to use the profiling tools on your app, though don't attach them to your production server! Use a test environment for it and see if you can replicate the problem.

Troubleshooting a Hanging Java Web App

I have a web application that hangs under high loads. I'm not going to go into the specifics of the code because I really just want some troubleshooting advice and tooling recommendations.
It's a web app, so each request get's a thread. Under a high load test, the app begins to consume all of the cpu, while becoming unresponsive. I suspect that the request threads are hanging in the new code that we are testing. Due to the fact of the cpu consumption, I'm assuming this must be on my app side. My understanding, which could be wrong, is that total cpu consumption indicated my first troubleshooting efforts should be in looking at the code that's consuming those cycles.
What are some tools and/or methods for inspecting which threads are hanging and on what lines of code? Again, I can easily force the app into the problematic behavior.
I've found and been trying out visualvm. Seems like the perfect tool. Still open for suggestions though. I looked at eclipse TPTP and it seems to be end-of-life-ing as well as requiring a more heavy weight deployment.
You can insert logging messages at starting a thread and closing a thread. Then you start the application and inspect the output while penetrating the code.
Another way is to look for memory leaks. If you are sure you haven't one, you can extend the virtual memory of your JVM.
#chad: do you have Database in whole picture...you may want to start by looking what is happening at DB side...you can very well look into DB locks, current sessions etc.

Memory leak or some other issues in my iPad application?

I am facing problems with my iPad application some times it gets hang-up my application and still I am not able to figure out the issues why it is happening again and again with my application. I have tested application through instrument. Please help me out how can I figure out what is the problem with my application or how to prevent memory related issues.
There are many tools to help find memory leaks in Objective C programs, some integrated nicely on the OS X platform. Look for "instruments", "clang static analyzer", or "Leaks".

Resources