I've created a PowerShell script to continuously log Blue Iris memory usage parameters for both the server, and the main Blue Iris process.
Because I found that Blue Iris can become erratic during a memory leak, the memory usage parameters are obtained via Powershell commands - instead of via Blue Iris by either of these approaches:
The design goal of the script is collect as much data as possible during a memory leak event.... Typically, the script would be executed every 3 minutes or so from Windows Task Scheduler. If you use a slower frequency (say every 5+ minutes) and are actively monitoring this file, this can be detrimental because, as just noted, the Blue Iris server can become erratic quite quickly during a memory leak event, and it can be helpful to know about it sooner rather than later.
The script's output is a CSV log file with the following columns:
HOW TO GUIDE...
STEP #1:
Install the script and its companion 'user settings file'
STEP #2:
Edit the user settings file
STEP #3:
Test the script from the PowerShell console
STEP #4
Automate the script from Task Scheduler.

USAGE GUIDE Screenshots:

SCRIPT ZIP FILE:
Because I found that Blue Iris can become erratic during a memory leak, the memory usage parameters are obtained via Powershell commands - instead of via Blue Iris by either of these approaches:
- querying the Blue Iris webserver via a JSON
status
command, or - using a Blue Iris Action Set write-to-a-file Action with macros
%014
,%012
and%017
.
The design goal of the script is collect as much data as possible during a memory leak event.... Typically, the script would be executed every 3 minutes or so from Windows Task Scheduler. If you use a slower frequency (say every 5+ minutes) and are actively monitoring this file, this can be detrimental because, as just noted, the Blue Iris server can become erratic quite quickly during a memory leak event, and it can be helpful to know about it sooner rather than later.
The script's output is a CSV log file with the following columns:
- Timestamp
- SoftwareUsedRamBytes - the memory used by the Blue Iris process
- Uptime - the uptime for the Blue Iris process
- RamPct - the memory used by the system
- Tag - used to identify background, console and simulation-created entries
- Host - used to identify the Windows process that called the script
If you are curious, this screenshot shows the CSV file as viewed by the Powershell Out-GridView cmdlet. I've previously posted about this and other lightweight CSV viewers. Of course, you can always simply open & inspect CSV files a text/code editor (like NotePad++). In some cases this can be preferable when you are searching for specific date pattern or events.
HOW TO GUIDE...
STEP #1:
Install the script and its companion 'user settings file'
- Extract all the files from the attached zip file to your desktop, or scripts folder.
- Please note that the folder used must be in your PC's environment path.
- Create a working folder for this script - it will be used to process the output CSV files.
- To use the folder, you must edit a user setting
$csv_logfile_path
in the user-settings script file (see STEP #2)
NOTE: If you've never used PowerShell on your Blue Iris PC, you may first to need to change its default security policy.
Open PowerShell in Administrator mode, and type the following, then hit the Enter key:
Set-ExecutionPolicy RemoteSigned
(click <here> for a nice beginner's tutorial to using PowerShell).
STEP #2:
Edit the user settings file
The user settings file is named 'BI_ram_logger_user_settings.ps1'
- Open the file in a text editor (a code text editor is recommended; I use Notepad++.
- Edit the REQUIRED SETTINGS section (see screenshot)
- Ignore the remaining settings for now. They provide customizations that you may want to explore later.
STEP #3:
Test the script from the PowerShell console
Open an Admin PowerShell window, or Powershell-ISE window (I use Windows Terminal):
Type the following command into the console.
BI_ram_logger.ps1 -Current
Hit the Enter key.
This will show the current parameters without logging the data.
Next, remove the argument -Current
BI_ram_logger.ps1
Hit the Enter key.
Both responses should look like following screenshot:
The script populates the working folder with CSV log files that are automatically rolled over every month.
Furthermore, the script automatically creates a 'stack' of the 5 most recent files, which makes it easier to use the most recent files for charting programs, etc.
STEP #4
Automate the script from Task Scheduler.

USAGE GUIDE Screenshots:


SCRIPT ZIP FILE:
Attachments
Last edited: