ArcGIS Server Memory Calculator - Script

PowerShell script to measure ArcSOC.exe memory usage

Get-ArcSOCMemory.ps1

Run this script on your ArcGIS Server machine to measure the actual memory usage of running ArcSOC.exe processes. The output includes working set and peak working set statistics, and suggests a value to use in the Advanced calculator.

When to run it: Run during a representative period of normal load - not during idle or during an unusually heavy spike. Peak working set values persist since the last server restart, so they reflect the historical high-water mark even if the server is currently quiet.

Usage

.\Get-ArcSOCMemory.ps1

If execution policy blocks the script, run:

powershell -ExecutionPolicy Bypass -File .\Get-ArcSOCMemory.ps1

Script

# Get-ArcSOCMemory.ps1
# Scans ArcSOC.exe, ArcGIS Server, and Java processes to report memory usage
# and suggest values for the Advanced calculator.

function Get-Median {
    param([double[]]$Values)
    $sorted = $Values | Sort-Object
    $count  = $sorted.Count
    if ($count -eq 0) { return $null }
    if ($count % 2 -eq 1) {
        return $sorted[($count - 1) / 2]
    } else {
        return ($sorted[$count / 2 - 1] + $sorted[$count / 2]) / 2.0
    }
}

# --- ArcSOC processes ---
$processes = Get-Process -Name "ArcSOC" -ErrorAction SilentlyContinue

if (-not $processes) {
    Write-Host "No ArcSOC.exe processes found." -ForegroundColor Yellow
    exit
}

$data = $processes | ForEach-Object {
    [PSCustomObject]@{
        PID            = $_.Id
        WorkingSet_MB  = [math]::Round($_.WorkingSet64     / 1MB, 1)
        PeakWorking_MB = [math]::Round($_.PeakWorkingSet64 / 1MB, 1)
    }
}

$wsValues   = $data.WorkingSet_MB
$peakValues = $data.PeakWorking_MB
$arcSOCTotal_MB = [math]::Round(($wsValues | Measure-Object -Sum).Sum, 1)

# --- ArcGIS Server overhead: ArcGISServer.exe + java* ---
$agsProcs = @(
    Get-Process -Name "ArcGISServer" -ErrorAction SilentlyContinue
    Get-Process | Where-Object { $_.Name -like "java*" }
) | Where-Object { $_ -ne $null }

$agsOverhead_MB = [math]::Round(($agsProcs | Measure-Object -Property WorkingSet64 -Sum).Sum / 1MB, 1)

# --- OS overhead: total RAM in use minus ArcSOC and ArcGIS processes ---
$os = Get-CimInstance Win32_OperatingSystem
$totalUsed_MB  = [math]::Round(($os.TotalVisibleMemorySize - $os.FreePhysicalMemory) / 1KB, 1)
$osOverhead_MB = [math]::Round($totalUsed_MB - $arcSOCTotal_MB - $agsOverhead_MB, 1)

# --- Output ---
Write-Host ""
Write-Host "ArcSOC.exe Memory Report" -ForegroundColor Cyan
Write-Host "========================" -ForegroundColor Cyan
Write-Host "Processes found: $($data.Count)"
Write-Host ""

$data | Sort-Object WorkingSet_MB -Descending | Format-Table -AutoSize

Write-Host "--- Working Set (Physical) ---" -ForegroundColor Green
Write-Host ("  Min    : {0,8:N1} MB" -f ($wsValues | Measure-Object -Minimum).Minimum)
Write-Host ("  Median : {0,8:N1} MB" -f (Get-Median $wsValues))
Write-Host ("  Mean   : {0,8:N1} MB" -f ($wsValues | Measure-Object -Average).Average)
Write-Host ("  Max    : {0,8:N1} MB" -f ($wsValues | Measure-Object -Maximum).Maximum)
Write-Host ("  Total  : {0,8:N1} MB" -f $arcSOCTotal_MB)
Write-Host ""
Write-Host "--- Peak Working Set ---" -ForegroundColor Green
Write-Host ("  Min    : {0,8:N1} MB" -f ($peakValues | Measure-Object -Minimum).Minimum)
Write-Host ("  Median : {0,8:N1} MB" -f (Get-Median $peakValues))
Write-Host ("  Mean   : {0,8:N1} MB" -f ($peakValues | Measure-Object -Average).Average)
Write-Host ("  Max    : {0,8:N1} MB" -f ($peakValues | Measure-Object -Maximum).Maximum)
Write-Host ""
Write-Host "--- ArcGIS Server Overhead (ArcGISServer.exe + java*) ---" -ForegroundColor Green
if ($agsProcs) {
    $agsProcs | Sort-Object WorkingSet64 -Descending | ForEach-Object {
        Write-Host ("  {0,-30} {1,8:N1} MB" -f $_.Name, ($_.WorkingSet64 / 1MB))
    }
    Write-Host ("  Total  : {0,8:N1} MB" -f $agsOverhead_MB)
} else {
    Write-Host "  No ArcGISServer or java processes found." -ForegroundColor Yellow
}
Write-Host ""
Write-Host "--- OS / Other Overhead ---" -ForegroundColor Green
Write-Host ("  Total RAM in use : {0,8:N1} MB" -f $totalUsed_MB)
Write-Host ("  ArcSOC total     : {0,8:N1} MB" -f $arcSOCTotal_MB)
Write-Host ("  ArcGIS overhead  : {0,8:N1} MB" -f $agsOverhead_MB)
Write-Host ("  OS / other       : {0,8:N1} MB" -f $osOverhead_MB)
Write-Host ""
Write-Host "Suggested values for Advanced Calculator:" -ForegroundColor Yellow
Write-Host ("  ArcSOC Memory    : {0,6:N0} MB  (peak median, rounded to nearest 100)" -f ([math]::Ceiling((Get-Median $peakValues) / 100) * 100))
Write-Host ("  ArcGIS Overhead  : {0,6:N0} MB  (rounded to nearest 100)"              -f ([math]::Ceiling($agsOverhead_MB / 100) * 100))
Write-Host ("  OS Overhead      : {0,6:N0} MB  (rounded to nearest 500)"              -f ([math]::Ceiling($osOverhead_MB / 500) * 500))
Write-Host ""

Output explained

FieldMeaningUse in calculator
Working Set Physical RAM currently used by each ArcSOC process right now Useful for a snapshot of current load
Peak Working Set Highest physical RAM each ArcSOC process has used since the server started Use this. Reflects realistic high-water mark across all load conditions seen so far
ArcGIS Server Overhead Working set sum of ArcGISServer.exe and all java* processes (javaw.exe etc.) Paste into ArcGIS Service Overhead in the Advanced calculator
OS / Other Overhead Total RAM in use minus ArcSOC and ArcGIS processes — everything else on the machine Paste into OS Overhead in the Advanced calculator
Suggested values ArcSOC peak median to nearest 100 MB; ArcGIS overhead to nearest 100 MB; OS overhead to nearest 500 MB Paste directly into the corresponding fields in the Advanced calculator