[PR #5801] [MERGED] Launcher: a Maximum memory row on Home (no limit by default) #6508

Closed
opened 2026-11-03 06:21:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5801
Author: @1038april
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/ram-limit-launcher


📝 Commits (3)

  • 3ca72c5 Launcher: a Maximum memory row on Home
  • c486c3a Merge main into #5801
  • 9761544 Launcher memory row: no limit until the player sets one

📊 Changes

19 files changed (+523 additions, -3 deletions)

View changed files

📝 launcher/Cargo.lock (+1 -0)
📝 launcher/Cargo.toml (+2 -0)
📝 launcher/README.md (+3 -0)
📝 launcher/lang/de.json (+8 -0)
📝 launcher/lang/es.json (+8 -0)
📝 launcher/lang/fr.json (+8 -0)
📝 launcher/lang/ja.json (+8 -0)
📝 launcher/lang/pl.json (+8 -0)
📝 launcher/lang/pt-br.json (+8 -0)
📝 launcher/lang/ru.json (+8 -0)
📝 launcher/lang/tr.json (+8 -0)
📝 launcher/lang/uk.json (+8 -0)
📝 launcher/lang/zh.json (+8 -0)
📝 launcher/src/cli.rs (+1 -0)
📝 launcher/src/launch.rs (+107 -0)
📝 launcher/src/launch/tests.rs (+62 -0)
📝 launcher/src/launch_page.rs (+248 -0)
📝 launcher/src/main.rs (+9 -2)
📝 launcher/src/servers_page.rs (+10 -1)

📄 Description

🤖 Opened by 1038april's AI agent (Claude Code, Opus 5.5), not by 1038april personally.

What and why

Fixes #5798. The launcher side of a RAM limit; the game side is in its own pull request and should go first, as older games ignore the variable.

A Maximum memory row on Home, per instance: a slider and a box that takes 4096, 4gb, or nothing for no limit, with no lowest value. It saves when the slider is released, on Enter, or when the box loses focus, including when Play is clicked straight after typing. For Horizon it reaches the game as HORIZON_MEMORY_LIMIT_MB. A Java instance's row sets its existing -Xmx value.

For maintainers to decide: the default. The author asked for 2048 MB on Horizon instances, so everyone who updates gets that limit without choosing it. That doesn't change the vanilla look, but it is a behaviour change on by default. On Windows it should cost little, as 1000 MB lost no frames in the game pull request's test. On Linux and macOS the game starts stepping the render distance down at about 1843 MB, and it held about 1500 MB at render distance 32 in a Windows test, so high settings could lose render distance or reach the last-resort crash. If that is too much, limiting the default to Windows or making it no limit is a small change in Launch::memory_limit.

"No limit" is saved as its own choice (no_memory_limit). The window's Play and the CLI's play pass the limit; modpack play and the MCP launch tool don't.

Tested on Windows in a scratch launcher with input sent to its window: slider, Enter, click away, 4gb, invalid text, empty box, restart. From a new launcher, Windows reported a 2048 MB working set maximum on the started game. After choosing no limit it reported 1 MB in one run and 4545 MB in another; neither comes from this code, which sets no limit in that case.

Not tested: a real Java instance; Linux and macOS (CI will be the first build). The new strings' translations are mine and haven't been read by native speakers.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on KernelOS-PC, against upstream/main at 5edb339a7, 1 min 43 s)

Check Result
Scope ⚠️ 20 files, +536 −3; 536 lines of code: over 500, split it if it can ship in parts; mixes game, launcher
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ✅ 511 passed (50 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (9 s)
launcher tests ❌ 354 passed, 2 failed (40 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The two failures aren't from this change: both account::tests fail in a parallel run here and pass with --test-threads=1. --quick, so harnesses weren't run. The size is just over the guideline; 80 lines are translations.

Screenshots

To be added by hand.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5801 **Author:** [@1038april](https://github.com/1038april) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/ram-limit-launcher` --- ### 📝 Commits (3) - [`3ca72c5`](https://github.com/horizon-rust/horizon/commit/3ca72c508842dd1c726cbb7a01ac96135a70c0e3) Launcher: a Maximum memory row on Home - [`c486c3a`](https://github.com/horizon-rust/horizon/commit/c486c3a7a692ba0eac054dec75631d1debe67bcd) Merge main into #5801 - [`9761544`](https://github.com/horizon-rust/horizon/commit/97615443fe1ef6c3bd75ce99513c069812812e1a) Launcher memory row: no limit until the player sets one ### 📊 Changes **19 files changed** (+523 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `launcher/Cargo.lock` (+1 -0) 📝 `launcher/Cargo.toml` (+2 -0) 📝 `launcher/README.md` (+3 -0) 📝 `launcher/lang/de.json` (+8 -0) 📝 `launcher/lang/es.json` (+8 -0) 📝 `launcher/lang/fr.json` (+8 -0) 📝 `launcher/lang/ja.json` (+8 -0) 📝 `launcher/lang/pl.json` (+8 -0) 📝 `launcher/lang/pt-br.json` (+8 -0) 📝 `launcher/lang/ru.json` (+8 -0) 📝 `launcher/lang/tr.json` (+8 -0) 📝 `launcher/lang/uk.json` (+8 -0) 📝 `launcher/lang/zh.json` (+8 -0) 📝 `launcher/src/cli.rs` (+1 -0) 📝 `launcher/src/launch.rs` (+107 -0) 📝 `launcher/src/launch/tests.rs` (+62 -0) 📝 `launcher/src/launch_page.rs` (+248 -0) 📝 `launcher/src/main.rs` (+9 -2) 📝 `launcher/src/servers_page.rs` (+10 -1) </details> ### 📄 Description > 🤖 Opened by 1038april's AI agent (Claude Code, Opus 5.5), not by 1038april personally. ## What and why Fixes #5798. The launcher side of a RAM limit; the game side is in its own pull request and should go first, as older games ignore the variable. A **Maximum memory** row on Home, per instance: a slider and a box that takes `4096`, `4gb`, or nothing for no limit, with no lowest value. It saves when the slider is released, on Enter, or when the box loses focus, including when Play is clicked straight after typing. For Horizon it reaches the game as `HORIZON_MEMORY_LIMIT_MB`. A Java instance's row sets its existing `-Xmx` value. **For maintainers to decide: the default.** The author asked for 2048 MB on Horizon instances, so everyone who updates gets that limit without choosing it. That doesn't change the vanilla look, but it is a behaviour change on by default. On Windows it should cost little, as 1000 MB lost no frames in the game pull request's test. On Linux and macOS the game starts stepping the render distance down at about 1843 MB, and it held about 1500 MB at render distance 32 in a Windows test, so high settings could lose render distance or reach the last-resort crash. If that is too much, limiting the default to Windows or making it no limit is a small change in `Launch::memory_limit`. "No limit" is saved as its own choice (`no_memory_limit`). The window's Play and the CLI's `play` pass the limit; `modpack play` and the MCP launch tool don't. Tested on Windows in a scratch launcher with input sent to its window: slider, Enter, click away, `4gb`, invalid text, empty box, restart. From a new launcher, Windows reported a 2048 MB working set maximum on the started game. After choosing no limit it reported 1 MB in one run and 4545 MB in another; neither comes from this code, which sets no limit in that case. **Not tested:** a real Java instance; Linux and macOS (CI will be the first build). The new strings' translations are mine and haven't been read by native speakers. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on KernelOS-PC, against upstream/main at 5edb339a7, 1 min 43 s) | Check | Result | | --- | --- | | Scope | ⚠️ 20 files, +536 −3; 536 lines of code: over 500, split it if it can ship in parts; mixes game, launcher | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ✅ 511 passed (50 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (9 s) | | launcher tests | ❌ 354 passed, 2 failed (40 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The two failures aren't from this change: both `account::tests` fail in a parallel run here and pass with `--test-threads=1`. `--quick`, so harnesses weren't run. The size is just over the guideline; 80 lines are translations. ## Screenshots To be added by hand. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:21:47 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6508
No description provided.