Skip to content

MTR Memory Saver 0.4.8 — NeoForge 21.1.265 preview

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 23 Nov 15:21
· 6 commits to main since this release
15b5c8a

Bilingual Release Notes: English | 简体中文

Summary

0.4.8 is a scoped client-side development pre-release for Minecraft 1.21.1, Java 21, NeoForge 21.1.265 (exact), and Official MTR 4.1.0-beta.2.

This release resolves the multi-reload heap exhaustion observed on earlier builds (0.4.7 4th-reload BBModel String.join OOM and initial 0.4.8 7th-reload OBJ String.join OOM) by streaming Blockbench, OBJ, and MTL inputs through single owned DELETE_ON_CLOSE UTF-16 snapshots and computing SHA-256 digests in a single read/write pass.


Key Changes in 0.4.8

  • Streaming Blockbench, OBJ & Material Inputs: Replaces synchronous whole-String assembly (String.join) on audited ResourceProvider paths with owned UTF-16 file snapshots and bounded 8 KiB readers/streams (StreamedObjCache, ResourceTextSnapshot), preserving native parsing and mesh construction.
  • Single-Pass Snapshot Digest (engineering-055): Computes UTF-8 SHA-256 inside the FilterReader pipeline while writing the UTF-16 snapshot channel, eliminating the redundant full-channel disk read pass before parsing. Across six balanced AB/BA pairs on the real 65.26 MB 02a05_arknight.bbmodel input, median thread CPU time dropped by 19.24% (wall-clock elapsed −19.37%, 6/6 pairs improved).
  • Retained Core Memory Architecture (0.4.x / 0.3.x Foundation): Keeps lossless 36-byte Deflater.BEST_SPEED packed vertices (0 CPU StoredVertexData), PartType.DISPLAY-only transform retention, epoch-shared vehicle JSON trees, 96 MiB bounded text LRU, 2 + 64 bounded descriptor scheduling, and MixinInitialisationError startup rejection (exit code 1) on mismatched MTR JARs.

Memory Footprint: Official MTR 4.1.0-beta.2 Alone vs With Memory Saver

Configuration -Xmx Heap Cap Sampled Java Heap Windows Working Set / Private Startup & F3+T Outcome
Official MTR 4.1.0-beta.2 Alone (Fabric, legacy 16 packs) 12 GiB (OOM) 11.98 GiB before crash; 9.87 GiB partial shallow heap (76.64M StoredVertexData + 75.31M Color) Not recorded in early baseline OutOfMemoryError (exit -1) before parsing completed (histogram)
Official MTR + Memory Saver v0.3.0 (NF265, same legacy 16 packs) 3 GiB (-Xmx3072M) 2.812–2.896 GiB (0 CPU StoredVertexData) WS 3.86–4.77 GiB (lifetime 5.36 GiB) / Private 4.02–5.62 GiB Startup + F3+T reload passed (2/2 clients, v0.3.0)
Official MTR + Memory Saver 0.4.8 (NF248/NF265, native-catalogue 16 packs) 3 GiB (-Xmx3072M) Steady 2.30–2.31 GiB (NF248); 20-reload med 2.35 GiB / peak 2.87 GiB (NF265) Steady WS 4.25–4.31 GiB / Priv 4.46–4.47 GiB (NF248); 20-reload med WS 4.39 GiB / Priv 4.87 GiB (NF265) Startup + 20 / 20 consecutive F3+T reloads passed (0 OOM, exit 0, nf265-reload20)

Note: The no-companion baseline was measured on Fabric 0.20.1 + legacy 16 packs (OS process counters omitted; no unmodified NeoForge 21.1.265 no-companion baseline is sealed yet). Remember -Xmx3072M limits Java heap only; total Windows process memory remains ~4.25–5.86 GiB.


Validation Scope vs Known Limits

Verified on exact official-nf265 product JAR (920c1f83...)

  • Automated Suites: 106 Java unit/regression tests (including -Xmx64M 40 MiB BBModel/OBJ streaming vs String.join OOM controls), 682 historical script index checks, and 354 Python tool tests pass.
  • Packaged Client & Binary Mismatch Checks: Passes 69 actual packaged client checks (24 lifecycle + 18 strict-resource + 27 OBJ), full sixteen-pack startup (1,092 declarations / 1,091 distinct IDs), readable JFR summary, and fatal exit code 1 before registration when launched against an altered MTR JAR (nf265-packaged).
  • 20 Consecutive Full 16-Pack F3+T Reloads (3 GiB Heap): Passes 20 / 20 consecutive native F3+T reloads in a fresh -Xms512M -Xmx3072M G1 JVM (epochs 3–22, 19 intermediate dual-clock >= 60 s stable intervals, 14/14 post-20 samples over 65.003 s, zero OOM, clean Alt+F4 exit 0, readable 213.90 MB JFR), independently replayable via evidence/engineering-056/nf265-reload20/verify_sealed.py (nf265-reload20).

Not Yet Certified / Excluded Scope

  • Whole-Client Performance Unconfirmed: Earlier 12-JVM paired Spark trials on NF248 (943b3d45... vs v0.3.0) missed the performance gates (−0.282% steady private memory vs <= -10%; +9.840% loading time vs <= +5%), with concurrent host workloads leaving timing attribution inconclusive (practical-spark, outlier-sensitivity). The optimized 920c1f83... candidate has not yet completed a full 48-JVM controlled client benchmark.
  • Open Functional Gates: Independent display-frame timing (ETW permission error / empty PresentMon CSV), a 2-hour uninterrupted route, and exhaustive full-catalog vehicle visual/window/door/boarding checks remain pending.
  • Custom Performance v6 Excluded: Only official-nf265 is built and released for 0.4.8; v6 work remains paused.

Installation & Checksums

  1. Download mtr-memory-saver-official-nf265-0.4.8.zip from this release's assets below.
  2. Put mtr-memory-saver-official-nf265-0.4.8.jar in your client's mods/ folder next to NeoForge 21.1.265 and Official MTR 4.1.0-beta.2.
  3. Remove any older mtr-memory-saver / mtr_memory_sharing companion JAR first. Do not install two versions together. The test observer probe is excluded from the release bundle.
Artifact SHA-256
mtr-memory-saver-official-nf265-0.4.8.zip ebc68df4241c6fce5af8b5816966aba070bf3d4da8b8c80e3d24e34e832568c2
mtr-memory-saver-official-nf265-0.4.8.jar 920c1f833b6f173c7443ff5956493b779acfeceb293fa640817a459985db3f5b
Official MTR 4.1.0-beta.2 JAR ff2b753d03f2bcc000d053a9014e4250c8ba720daa9b69b6899fe7dc26be1efa

Links: Release Decision · Support Scope · Install & Rollback · Technical Principles (zh-CN)


简体中文说明

0.4.8 是面向 Minecraft 1.21.1 客户端、Java 21、NeoForge 21.1.265(精确版本) 与 官方 MTR 4.1.0-beta.2 的限定范围开发预发布版本。

本版本针对前期构建在连续重载时触发的堆耗尽问题(0.4.7 第 4 次重载 BBModel String.join OOM 与 0.4.8 初版第 7 次重载 OBJ String.join OOM),改用单一所有权的 DELETE_ON_CLOSE UTF-16 快照流式读取 .bbmodel、.obj 与 .mtl,并将 SHA-256 哈希计算合并进写盘读取的单遍循环中。

主要更新

  • BBModel / OBJ / MTL 全链路流式读取:在已审计的原生 ResourceProvider 入口以流式快照代替 String.join 整块字符串拼接(StreamedObjCache、ResourceTextSnapshot),保留原生解析与网格计算逻辑。
  • 单遍边写边算哈希优化(engineering-055):在 FilterReader 写入 UTF-16 通道的同一遍循环内计算 UTF-8 SHA-256,省去解析前的二次读盘步骤。以 65.26 MB 真实 02a05_arknight.bbmodel 运行 6 对均衡 AB/BA 微基准测得:NF265 线程 CPU 中位下降 19.24%,墙钟耗时下降 19.37%(6 对全部改善)。
  • 既有基础机制:保持 36 字节/顶点 Deflater.BEST_SPEED 无损压缩(0 个 CPU StoredVertexData)、仅留 PartType.DISPLAY 变换、同世代共享车辆配置 Gson 树、96 MiB 有界压缩文本 LRU、2 + 64 有界调度队列以及不匹配 MTR JAR 注册前退出码 1 拦截(MixinInitialisationError)。

内存占用对比:仅装官方 MTR 4.1.0-beta.2 vs 安装 Memory Saver

对比配置 -Xmx 堆上限 采样 Java 堆占用 Windows 工作集 / 私有提交 启动与 F3+T 热重载结果
仅装官方 MTR 4.1.0-beta.2(Fabric,旧 16 包) 12 GiB(OOM) 崩溃前 11.98 GiB;部分加载浅堆 9.87 GiB(含 76.64M 顶点 + 75.31M Color) 早期基线未采集 解析未完成即 OutOfMemoryError(退码 -1,堆直方图)
官方 MTR + Memory Saver v0.3.0(NF265,同旧 16 包) 3 GiB(-Xmx3072M) 2.812–2.896 GiB(0 个 CPU StoredVertexData) WS 3.86–4.77 GiB(高水位 5.36 GiB)/ Private 4.02–5.62 GiB 启动与 F3+T 通过(2/2 客户端,v0.3.0)
官方 MTR + Memory Saver 0.4.8(NF248/NF265,原生目录 16 包) 3 GiB(-Xmx3072M) 稳态 2.30–2.31 GiB(NF248);20 次重载中位 2.35 GiB / 峰值 2.87 GiB(NF265) 稳态 WS 4.25–4.31 GiB / Priv 4.46–4.47 GiB(NF248);20 次重载中位 WS 4.39 GiB / Priv 4.87 GiB(NF265) 启动与 20 / 20 次连续 F3+T 重载通过(0 OOM,退码 0,nf265-reload20)

说明:无伴侣基线采自 Fabric 0.20.1 + 旧 16 包(未采集 OS 进程内存,尚未单独封存不装伴侣模组的 NeoForge 21.1.265 基线)。-Xmx3072M 仅约束 Java 堆,含原生与显存开销后的 Windows 实际进程内存约为 4.25–5.86 GiB。

验证范围与未关闭限制

  • 已验证项(产物 JAR 920c1f83...):
    • 106 项 Java 回归测试(含 -Xmx64M 流式 vs String.join OOM 负对照)、682 份历史脚本校验与 354 项 Python 工具测试全部通过;
    • 实机 NF265 客户端通过 69 项打包检查(24 生命周期 + 18 严格资源 + 27 OBJ)、全 16 包启动(1,092 声明 / 1,091 去重 ID)、JFR 读取及假包注册前退出码 1 拒绝;
    • 在 -Xms512M -Xmx3072M(3 GiB 堆上限)下连续通过 20 / 20 次真实全 16 包 F3+T 热重载(epochs 3–22,19 个中间 >= 60 s 双时钟稳定区间,末轮后 14/14 样本覆盖 65.003 s,0 OOM,Alt+F4 正常退出码 0,可读 213.90 MB JFR)。
  • 未认证 / 待关闭项:
    • 尚不能宣称整客户端性能达标:此前在 NF248 上运行的 12-JVM 实用 Spark 对照(943b3d45... vs v0.3.0)未达到 -10% 稳态私有内存与 +5% 加载门槛(实测 −0.282% / +9.840%),且因并发宿主机负载导致耗时因果归因 inconclusive;优化后的 920c1f83... 尚未运行 48-JVM 整客户端对照协议。
    • 其余 P1 待闭门禁:独立显示帧呈现采集(ETW 权限拒绝 / PresentMon 无有效 CSV)、两小时连续路线(历史 01–03 失败)及全车系外观/车门/上下车交互。
    • 定制 Performance v6 除外:0.4.8 仅发布 official-nf265,v6 目标继续暂停。

安装方式与校验和

  1. 从下方 Assets 下载 mtr-memory-saver-official-nf265-0.4.8.zip。
  2. 取出内部的 mtr-memory-saver-official-nf265-0.4.8.jar 放入客户端 mods/ 目录,并确保配套 NeoForge 21.1.265 与 官方 MTR 4.1.0-beta.2。
  3. 安装前请先移除旧版伴侣 JAR(不要同时保留两份)。独立测试观察器探针未打入正式压缩包。
文件 SHA-256 指纹
mtr-memory-saver-official-nf265-0.4.8.zip ebc68df4241c6fce5af8b5816966aba070bf3d4da8b8c80e3d24e34e832568c2
mtr-memory-saver-official-nf265-0.4.8.jar 920c1f833b6f173c7443ff5956493b779acfeceb293fa640817a459985db3f5b
官方 MTR 4.1.0-beta.2 JAR ff2b753d03f2bcc000d053a9014e4250c8ba720daa9b69b6899fe7dc26be1efa

更多证据与文档:打包检查 · 20 次重载证明 · 单遍摘要微基准 · 发布裁决 · 完整技术原理