What can slow down the application and the system?

I am debugging an application that greatly slows down the system . The application downloads a large amount of data (about 1000 files and a half MB) from the local hard drive. Files are downloaded as memory mapped files and are displayed only when necessary. This means that at any given time the use of virtual memory does not exceed 300 MB.

I also checked the Handle account with handle.exe from sysinternals and found that no more than 8000 odd pens were open. When the data is unloaded, it drops to about 400. After each load and unload, there are no handle leaks.

After 2-3 load unloading cycles, at one load, the system becomes very slow. I checked the use of the virtual memory of the application, as well as the number of handlers at that moment, and this was within the limits (VM about 460 MB, not much fragmentation, the number of handlers is 3200).

I want how an application can make the system respond very slowly? What other tools can I use to debug this script?

Let me clarify, when I mean the system, these are all windows that slow down. The task manager itself takes 2 minutes, and most often a hard reset is required.

+4
source share
7 answers

Tools you can use at this stage:

  • Perfmon
  • Event Viewer

In my experience, when something happens to a system that prevents the task manager from appearing, it's usually a hardware kind. Checking the System Event Log Event Viewer is sometimes just full of warnings or errors that some hardware device is shutting down.

If the Event Viewer does not indicate that any hardware error is causing a hang, try Perfmon - add counters for system objects to track file reads, exceptions, context switches, etc. per second and see if there is something obvious there.

Frankly, the demonstrated behavior is shown to be impossible — by design — for user-mode code. WinNT makes great efforts to isolate applications from each other and prevent rogue applications from being unusable. Therefore, my suspicion is some kind of hardware malfunction. Is there a chance that you can just run the same test on another PC?

+1
source

The fact that the whole system slows down is very annoying, which means you can’t easily attach the profiler, it also means that it would be difficult to stop the profiler session to view the results (since you said that it requires a hard reboot).

The best tool to work in this situation is ETW (Event Tracing for Windows), these tools are great and give you the exact answer you are looking for.

Check them out here.

http://msdn.microsoft.com/en-us/library/cc305210.aspx as well as http://msdn.microsoft.com/en-us/library/cc305221.aspx and http://msdn.microsoft. com / en-us / performance / default.aspx

Hope this works. Thanks

+1
source

You use tools such as IBM Rational Quantify or Intel VTune to identify performance issues.
[EDIT]
Like Benoit, one good tool is to measure time to determine what the processor is eating.
But remember that, since you work with many files, it will most likely be absent, which will lead to the replacement of memory to disk.

0
source

If you do not have profilers, you may have to do the same job manually ...

Have you tried commenting out all the read / write operations, just to check if the slowdown disappears? Divide and Win strategies will help you find where the problem is.

0
source

If you run it under the IDE, run it until it becomes very slow, and then click the pause button. You will catch it in action by doing so much time.

0
source

when the task manager takes 2 minutes, do you get a lot of activity on the disk? or is it connected by cpu?

I would try a process handler from sysinternals. When your system is in a slow state and you are trying to run, say, notepad, pay attention to the page error delta.

0
source

Windows is very greedy for caching file data. I would try deleting the I / O files as someone suggested, and also make sure that you close the file association as soon as you are done with the file. I / O is likely to slow down, especially if your files are on the same drive as the OS. Another way to verify that it will move your files to another drive and see if the problem is fixed.

0
source

All Articles