Performance & Memory

Configure memory limits and Chromium flags for large maps

Large maps (Osaka, Greater LA, Nagoya, etc.) can exhaust the renderer's memory. The app auto-allocates V8 heap based on your system RAM, but power users can override this.

Memory Limit#

The app auto-scales the V8 heap to (total RAM - 2GB), with a minimum of 2GB. To override, add memoryLimitMB to your settings.json:

json
{
    "memoryLimitMB": 16384
}

This sets the V8 heap to 16GB. Minimum value is `1024` (1GB). Restart the app after changing.

Settings File Location#

PlatformPath
macOS~/Library/Application Support/Subway Builder/settings.json
Windows%APPDATA%\Subway Builder\settings.json
Linux~/.config/Subway Builder/settings.json

Chromium Flags#

For advanced users, you can pass arbitrary Chromium/V8 flags via settings.json:

json
{
    "chromiumFlags": [
        "--disable-gpu",
        "--enable-logging"
    ]
}

User flags are applied after the app's built-in defaults, so they can override anything. Restart required.

Verifying Your Settings#

Open DevTools (enable DEBUG_PROD or press Ctrl+Shift+I) and look for the startup log:

[Perf] System: 32GB RAM, 16 cores - heap limit: 16.0GB (user override)

If you see (auto) instead of (user override), your memoryLimitMB setting isn't being read β€” check the file path and JSON syntax.

If you set chromiumFlags, you'll also see:

[Flags] Applied 2 user flag(s): --disable-gpu, --enable-logging

Reading System Info from a Mod#

javascript
// Only available in Electron (not web)
const info = await window.electronAPI?.getSystemPerformanceInfo?.();
if (info) {
    console.log(`Heap: ${info.heapSizeMB}MB (override: ${info.heapSizeIsUserOverride})`);
    console.log(`RAM: ${info.totalRAMGB}GB, Cores: ${info.cpuCores}`);
}
PropertyTypeDescription
totalRAMGBnumberTotal system RAM in GB
cpuCoresnumberCPU core count
heapSizeMBnumberActive V8 heap limit in MB
heapSizeIsUserOverridebooleanWhether memoryLimitMB was set
platformstring'darwin', 'win32', or 'linux'
archstring'x64', 'arm64', etc.

Common Large-Map Issues#

SymptomLikely CauseFix
App crashes silently on large citiesRenderer OOMIncrease memoryLimitMB
Map tiles stop loadingMemory pressureReduce map quality or increase heap
Game slows down over timeGC thrashing near heap limitGive more headroom (set 2-4GB above what you need)
[Perf] log shows correct heap but still OOMNative/WASM memory (not V8)This is a different issue β€” report on Discord with the [Perf] log output