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:
{
"memoryLimitMB": 16384
}This sets the V8 heap to 16GB. Minimum value is `1024` (1GB). Restart the app after changing.
Settings File Location#
| Platform | Path |
|---|---|
| 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:
{
"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-loggingReading System Info from a Mod#
// 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}`);
}| Property | Type | Description |
|---|---|---|
totalRAMGB | number | Total system RAM in GB |
cpuCores | number | CPU core count |
heapSizeMB | number | Active V8 heap limit in MB |
heapSizeIsUserOverride | boolean | Whether memoryLimitMB was set |
platform | string | 'darwin', 'win32', or 'linux' |
arch | string | 'x64', 'arm64', etc. |
Common Large-Map Issues#
| Symptom | Likely Cause | Fix |
|---|---|---|
| App crashes silently on large cities | Renderer OOM | Increase memoryLimitMB |
| Map tiles stop loading | Memory pressure | Reduce map quality or increase heap |
| Game slows down over time | GC thrashing near heap limit | Give more headroom (set 2-4GB above what you need) |
[Perf] log shows correct heap but still OOM | Native/WASM memory (not V8) | This is a different issue β report on Discord with the [Perf] log output |