Tag Archive for Performance analysis

Sharing violation issues? How to find opened/locked files on Windows?

OpenedFilesView displays the list of all opened files on your system. It also shows a detailed additional information on handle value, read/write/delete access, file position, the process that opened the file, and a lot more on thos opened/locked files.

This utility is especially useful if you try to delete/move/open a file and you get one of the following error messages:

  • Cannot delete [filename]: There has been a sharing violation. The source or destination file may be in use.
  • Cannot delete [filename]: It is being used by another person or program. Close any programs that might be using the file and try again.
  • When you feel that a file is maliciously being used by a malware/spyware etc.

OpenedFilesView also lets you close those opened/locked files (except those opened by Windows kernel).

openedfilesview

You need to have Admin privileges in-order to run the tool. It mostly works on all newer versions of Windows (except Windows 95/Me/NT). OpenFilesView is a standalone executable, doesn’t need any supporting DLLs (that’s cool).

Well, How does it work?

As the Author puts it;

“OpenedFilesView uses the NtQuerySystemInformation API to enumerate all handles in the system. After filtering non-file handles, it uses a temporary device driver - NirSoftOpenedFilesDriver.sys for reading the information about each handle from the kernel memory. This device driver is automatically unloaded from the system when you exit from OpenedFilesView utility”

RSS Feed

5 programs to defragment your Hard Drive!

Last week, we had featured Registry Cleaning programs for Windows to keep Windows top. This is a follow-up for that post, here we explore file fragmentation and its impact on computer performance.

Why do you need Disk Defragmenter?

All modern day operating systems like Microsoft Windows (sometimes on Linux, Mac OS) etc are prone to file fragmentation. File fragmentation is a condition where file blocks are way too scattered and this condition considerably slows down your computer’s performance. Primary reason for this is that your Hard Disk head needs to move (seek) around too much to read the file blocks. Disk seeks are slow comparatively and slows down your overall system performance. Fragmentation of files is very common on Windows, however, not a major problem on operating systems like Linux.

So it is recommended that you keep defragmenting the files with the help of tools that bring all file blocks which are best kept sequentially together.

This is is shown in the following animation (Source Wikipedia)

FragmentationDefragmentation

List of free programs to defragment your disk (for Windows)

1. JkDefragis an open source disk defragmenting utility for Microsoft Windows platform. It is extremely fast compared to the default Windows Defragment utility and efficient.

http://upload.wikimedia.org/wikipedia/en/5/57/Defraggler_icon.png

2. Defraggler It can defrag individual file or group of files on FAT32 or NTFS (Windows) file system. Defraggler is again from the same company that gave you the amazing registry cleaner CCleaner that we featured a while ago.

File:Defragglerscreen.png

3. AusLogic’s Disk Defrag – It is also a fast and reliable defragmenter for Windows file systems like NTFS, FAT16/32. It supports a lot of features and useful.

overall

4. WinContig – It is an easy-to-use, fast and stand-alone defragmentation tool that doesn’t create any installation directories or Registry entries on your computer. It is designed for Windows operating system.

5. PageDefrag – is from SysInternals team and a fast defragmenter for Windows.

bb897426.PageDefrag(en-us,MSDN.10)

Rssfeed

12 Source Code Profilers for C & C++

Code Profilers are very distinct from traditional debuggers. They are able to catch the trivial and non fatal coding errors which are often hard for humans to catch. These trivial bugs later claim weeks of debugging and extra cost to fix. Code profilers will save you hours of debugging time. These tools can automatically detect many memory management and threading, etc bugs. These tools will give you confidence that your programs are free of many common bugs, some of which would take hours to find manually, or never be found at all. You can find and eliminate bugs before they become a problem.

As usual, there are a lot of code profilers available for C/C++. Here is a list of very prominent such players.

1. Insure++ (For Windows, Linux, UNIX like)

image

Insure++ is a runtime memory analysis and error detection tool for C and C++ that automatically identifies a variety of difficult-to-track programming and memory-access errors, along with potential defects and inefficiencies in memory usage. Errors such as memory corruption, memory leaks, access outside of array bounds, invalid pointers, and the like often go undetected during normal testing, only to result in application crashes in the field. Insure++ will help you find and eliminate such defects in your applications to ensure the integrity of their memory usage.

During testing, Insure++ checks all types of memory references, including those to static (global), stack, and shared memory — both in user’s code and in third party libraries.

Errors that Insure++ detects include: Corrupted heap and stack memory, Use of uninitialized variables and objects, Array and string bounds errors on heap and stack, etc.

2. Rational Purify (For Windows and Linux/UNIX)

image

IBM Rational Purify is a runtime analysis solution designed to help developers write more reliable code such as C++ and C. Reliability is ensured via two crucial functions: memory corruption detection and memory leak detection. Rational Purify packages support for these two runtime analysis capabilities in a single product with a common insta ll and licensing system.

3. Valgrind (For UNIX like)

Valgrind is an award-winning instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tools.

The Valgrind distribution currently includes six production-quality tools: a memory error detector, two thread error detectors, a cache and branch-prediction profiler, a call-graph generating cache profiler, and a heap profiler. It also includes one experimental tool, which detects out of bounds reads and writes of stack, global and heap arrays. It runs on the following platforms: X86/Linux, AMD64/Linux, PPC32/Linux, PPC64/Linux.

Valgrind works with programs written in any language. Because Valgrind works directly with program binaries, it works with programs written in any programming language, be they compiled, just-in-time compiled, or interpreted. The Valgrind tools are largely aimed at programs written in C and C++, because programs written in these languages tend to have the most bugs! But it can, for example, be used to debug and profile systems written in a mixture of languages. Valgrind has been used on programs written partly or entirely in C, C++, Java, Perl, Python, assembly code, Fortran, Ada, and many others.

Valgrind is Free and Open Source Software. Read here for more on Valgrind.

4. Zoom (For Linux)

image

image

Zoom is a graphical, low-overhead, sampling profiler for Linux from RotateRight which diagnoses performance problems related to CPU and memory-intensive code. Zoom supports Call Tree Visualization, Code Visualization etc. It is really easy to correlate assembly and actual source, bottlenecks in the code etc. Zoom supports DWARF (debugging data format).

5. Code Analyst (For Windows and Linux)

image

AMD CodeAnalyst Performance Analyzer is a suite of powerful tools that analyze software performance on AMD microprocessors and help developers optimize application performance. It uses a profiling technique to identify performance areas and issues within the system. Using this suite of tools, developers can get visibility into overall system performance, and can navigate into different modules and functions to locate hotspots within the target application.

CodeAnalyst allows you to profile applications using various performance events available on different AMD processors. You can specify performance events to target various functional units of the processor, or profiling granularity to adjust the accuracy of the result.

CodeAnalyst is designed to profile the performance of binary modules, including user mode application modules and kernel mode driver modules. Timer-Based Profiling and Event-Based Profiling collect data from multiple processors in a multi-processor system. It can support any language as it works with the binary.

6. Sleepy (For Windows)

image

‘Sleepy’ is a non-invasive profiler for the Windows platform that allows statistical profiling of C++ applications through sampling the instruction pointer register. Sleepy presents results in a GUI built with wxWindows.

The Sleepy profiler uses a technique where the profiler runs in a different thread from the target program. Every 1ms or so, the profiler thread suspends the target thread, and pulls out the current instruction pointer register value from the thread context. These mem addresses are resolved into procedure names and line numbers using debug information. This allows line-level resolution, without making any changes to the target program. The only requirement is that the target program is compiled with (MS) debug information

Sleepy uses the MS Debug Help (dbghelp) library to read debug information, and is therefore limited to the debug info formats that dbghelp can understand. As far as I know, debug information produced by non-MS compilers such as GCC will not be understood, and therefore such code cannot be profiled.

An improved version Very Sleepy is also available.

7 Intel VTune (For Windows and Linux)

image

VTune Performance Analyzer is Intel Corporation‘s tool for call graph or analyzing a set of tuning events. It works with C/C++/Fortan/.NET/Java and other applications on Linux or Windows, but only when running on selected Intel hardware. he GUI assists in various kinds of code profiling including time based profile, Event based profile etc.

VTune Performance Analyzer evaluates applications on all sizes of systems based on Intel® processors, from embedded systems through supercomputers, to help you improve application performance. VTune Performance Analyzer makes application performance tuning easier and is indispensable for making your software run its fastest on the latest single and multi-core systems.

8. AQTime (For Windows)

image

AQtime is a complete, top-to-bottom performance profiler and memory usage debugger for all major Windows development tools (Delphi, Visual Basic, Visual C++, and C++Builder), .NET compilers (including both Microsoft and non-Microsoft) and for VBScript and JScript routines. It includes several profilers and productivity tools that provide you with an unrivaled level of information on the state of your 32- and 64-bit software projects - from inception to delivery!

9. BullseyeCoverage (For Windows, Linux, Solaris and many more)

image

BullseyeCoverage is a code coverage analyzer for C++ and C that tells you how much of your source code was tested. You can use this information to quickly focus your testing effort and pinpoint areas that need to be reviewed. Code coverage analysis is useful during unit testing, integration testing, and final release. BullseyeCoverage enables you to create more reliable code and save time.

Function coverage gives you a quick overview and condition/decision coverage gives you high precision Works with everything you can write in C++ and C, including system-level and kernel mode Short learning curve, Integrated with Microsoft Visual Studio, Include or exclude any portion of your project code, Run-time source code included, for custom environments, Simple licensing, Merge results from distributed testing etc.

10. C++ Profiler Tool (For Windows)

image

The C++ Profiler tool enables the collection and display of execution profile data on C++ software source code bases of arbitrary size.

11. Shiny Profiler (For Windows, UNIX Like, Source code is portable)

Shiny is a low overhead, well documented and lightning fast C++ profiler. Easy to use on existing projects, no extensive surgery, just have fun with it. Nicely formatted output provides call tree (call graph), flat profile and is simple to custom display

12. Deleaker (For Windows)

image

Deleaker is a run-time error detection and debugging tool for Visual C++ developers. Deleaker is a really useful add-in for Visual Studio that helps you to analyze programming errors, many of which are unique to Visual C++. With Deleaker you can detect and localize resource leaks such as memory, GDI and USER objects, handles.

Resource leaks. Even a robust Windows-based application is not safe from them. Of all bugs they are the most difficult to find especially when they appear in graphics device interface (GDI) objects and menus. And as we all know, the earlier you catch bugs, the less expensive they are. Plenty of tools exist to help track down memory leaks. But there are very few good tools to help track GDI resource leaks that can ruin performance on any Windows operating system. Deleaker is one of them and the fact that it almost doesn’t slow down your application makes it your natural choice.

Related Posts with Thumbnails