> ## Documentation Index
> Fetch the complete documentation index at: https://docs.botifymanager.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# process-optimizer

> The 5-component system that makes running 15–30+ Roblox instances possible on any PC.

The Process Optimizer is a suite of **five subsystems** that dramatically reduce the RAM and CPU cost of running many Roblox instances simultaneously. Together, they make it possible to run 15–30+ instances on hardware that would otherwise struggle with 5.

Enable/disable everything with the master toggle: **Settings → Memory & CPU Optimizer → Process Optimizer (Master)**.

***

## Component Overview

<CardGroup cols={2}>
  <Card title="Working Set Trimmer" color="#3b82f6" icon="memory-stick">
    Drops per-instance RAM from \~450MB to \~70MB by forcing Windows to page out idle memory.
  </Card>

  <Card title="CPU Affinity Manager" color="#3b82f6" icon="cpu">
    Pins each Roblox instance to specific CPU cores via round-robin assignment.
  </Card>

  <Card title="Process Priority Manager" color="#3b82f6" icon="gauge">
    Sets CPU scheduling and I/O priority to keep the OS and Botify responsive.
  </Card>

  <Card title="Crash Handler Killer" color="#3b82f6" icon="shield-x">
    Auto-kills `RobloxCrashHandler.exe` every 30s — saves 15–30MB per instance.
  </Card>

  <Card title="Memory Monitor" color="#3b82f6" icon="chart-bar">
    Real-time per-instance and system RAM tracking with configurable warning alerts.
  </Card>
</CardGroup>

***

## 1. Working Set Trimmer

Forces Windows to page out Roblox's idle memory to disk — dramatically reducing active RAM per instance.

| Mode                 | Win32 API                    | RAM per Instance |
| -------------------- | ---------------------------- | ---------------- |
| **Gentle** (default) | `SetProcessWorkingSetSizeEx` | \~80–100 MB      |
| **Aggressive**       | `EmptyWorkingSet`            | \~60–80 MB       |

**Deferred Mode (`trim_only_in_game`):**

* Waits \~2 minutes for bots to fully load before the first trim
* Skips processes younger than **120 seconds** to prevent connection timeouts during the join phase

**Trim Interval:** Runs every `trim_interval` seconds (default: **120s**)

<Tip>
  Enable **Aggressive Trim** when running 20+ instances. Pair with **Ultra-Low GPU Mode** for maximum RAM savings.
</Tip>

**Real-World RAM Impact:**

```text theme={null}
No optimizer:     15 instances × 450 MB = 6.75 GB
Gentle trim:      15 instances × 90 MB  = 1.35 GB
Aggressive trim:  15 instances × 70 MB  = 1.05 GB
```

***

## 2. CPU Affinity Manager

Distributes Roblox instances across CPU cores using round-robin assignment — preventing multiple instances from competing for the same cores.

* **Core 0** is always reserved for the OS and Botify
* Each instance is pinned to `cores_per_instance` cores (1–4, configurable)
* Assignments are **re-verified on each optimizer cycle** in case processes respawn

**Example — 8-core CPU, 2 cores per instance:**

```text theme={null}
Instance 1 → Cores 1–2
Instance 2 → Cores 3–4
Instance 3 → Cores 5–6
Instance 4 → Cores 7–8
Instance 5 → Cores 1–2  (wraps)
```

***

## 3. Process Priority Manager

Sets both **CPU scheduling priority** and **I/O priority** for all Roblox processes.

| Priority      | Recommended For                                 |
| ------------- | ----------------------------------------------- |
| `Realtime`    | ⚠️ Not recommended — can destabilize the system |
| `High`        | 1–5 instances                                   |
| `AboveNormal` | Light loads                                     |
| `Normal`      | Windows default                                 |
| `BelowNormal` | **10–20 instances (default)**                   |
| `Idle`        | 20+ instances                                   |

Also sets **I/O priority to Very Low** via `NtSetInformationProcess` — prevents disk-heavy Roblox asset loading from blocking other processes.

***

## 4. Crash Handler Killer

`RobloxCrashHandler.exe` launches automatically with every Roblox instance and serves no purpose for bot accounts.

* Auto-killed every **30 seconds**
* **15–30 MB** saved per instance
* At 20 instances: saves **300–600 MB** total
* Safe to kill — does not affect gameplay, stability, or connectivity

***

## 5. Memory Monitor

Tracks system and per-instance memory in real time (updates every 10 seconds):

| Metric                            | Description                               |
| --------------------------------- | ----------------------------------------- |
| **Total Roblox RAM**              | Sum of all Roblox process working sets    |
| **Per-Instance Average**          | Total Roblox RAM ÷ running instance count |
| **System RAM %**                  | OS-level memory utilization               |
| **Available RAM**                 | Free system memory                        |
| **Est. Max Additional Instances** | `(available RAM − 1 GB) ÷ 100 MB`         |

Warning appears in the status bar when system RAM exceeds `memory_warn_threshold` (default: **85%**).

***

## Recommended Settings by Instance Count

| Instance Count | Working Set | Aggressive | GPU Mode  | Priority    | Max Concurrent |
| -------------- | ----------- | ---------- | --------- | ----------- | -------------- |
| 1–5            | Optional    | Off        | Low GPU   | Normal      | 5              |
| 6–14           | On          | Off        | Low GPU   | BelowNormal | 14             |
| 15–25          | On          | On         | Ultra-Low | BelowNormal | 25             |
| 25+            | On          | On         | Ultra-Low | Idle        | 40+            |
