diskmon

A Windows Program to find out which processes writes most data to which drives and which files they write per process during the monitored time. (Created with claude)


Project maintained by joyrider3774 Hosted on GitHub Pages — Theme by mattgraham

DiskMon

DiskMon main window

DiskMon is a small Windows disk I/O monitor. It shows, per drive, how fast data is read and written right now, how much has been read and written since the program started, and which processes and files are responsible.

It is a single native Win32 executable written in C++ with no external dependencies.

DiskMon was made with the help of Claude, Anthropic’s AI assistant.

Features

Drives (top list)

One row per fixed or removable drive, plus an All drives row:

Column Meaning
Read/s, Write/s Current read and write speed
Total read, Total written Bytes read and written since the program started (or since the last reset)
Top writer process The process (or process group) that wrote the most data to the drive
Most written file The file that received the most writes on the drive

An Other / unresolved row appears when processes do I/O on network shares or on files whose name could not be resolved.

Selecting a drive filters the two lists below to that drive.

Processes (middle list)

Every process that did file I/O, with read/s, write/s, total read and total written for the selected drive. It also has a read and written column for each drive, plus Other. Processes that have exited stay in the list, marked Exited.

Most written files (bottom list)

The top 100 most written files for the selected drive, or for the selected process or group. Each row shows bytes written, bytes read, the process that wrote the most to the file, and the full path.

Right-click a file for Open folder in Explorer, which opens the folder with the file selected, or Copy path. If the file has since been deleted, the nearest folder that still exists is opened.

Other

How it measures

DiskMon uses two different data sources, so drive totals and process/file totals will not match exactly.

Drive speeds and totals come from the Windows performance counters LogicalDisk(X:)\Disk Read Bytes/sec and Disk Write Bytes/sec. They measure the I/O that actually reaches the disk.

Per-process and per-file numbers come from a kernel ETW (Event Tracing for Windows) session that records file read and write requests. They measure the data each process asked to read or write. Each file is assigned to a drive by its path.

Kernel tracing requires administrator rights, so DiskMon always asks for elevation (UAC) when started.

Requirements

Building

DiskMon is built with the GCC toolchain from MSYS2 (UCRT64 environment).

  1. Install MSYS2, then install the toolchain from an MSYS2 shell:

    pacman -S mingw-w64-ucrt-x86_64-gcc
    
  2. Run the build script from a Windows command prompt:

    build.bat
    

    The script expects the toolchain in C:\msys64\ucrt64\bin. If MSYS2 is installed elsewhere, set MSYS2_BIN first:

    set MSYS2_BIN=D:\msys64\ucrt64\bin
    build.bat
    

The result is diskmon.exe. If diskmon.ico does not exist, the script first builds and runs tools/mkicon.cpp to generate it.

GitHub Actions

.github/workflows/build.yml builds DiskMon on a Windows runner. It only runs when started manually: open the Actions tab, select Build and click Run workflow. It installs the UCRT64 gcc toolchain with msys2/setup-msys2 and runs build.bat.

Each run uploads diskmon.exe and README.md as a build artifact named diskmon, which you can download from the run’s summary page.

Distribution

Only diskmon.exe is needed. It is statically linked, so it needs no MSYS2 or GCC runtime DLLs. The manifest (administrator rights, visual styles) and the icon are embedded in it.

Files

File Purpose
diskmon.cpp The whole application
diskmon.rc Resource script (manifest and icon)
diskmon.manifest Requests administrator rights and common controls v6
diskmon.ico Application icon (generated)
tools/mkicon.cpp Generates diskmon.ico
docs/screenshot.png Screenshot used in this README
build.bat Build script
.github/workflows/build.yml GitHub Actions build workflow (manual)

Settings and system changes