Skip to content

feat: 内存管理可以设置初始大小和最大大小 - #3565

Open
qsc1918 wants to merge 8 commits into
PCL-Community:devfrom
qsc1918:aaa
Open

feat: 内存管理可以设置初始大小和最大大小#3565
qsc1918 wants to merge 8 commits into
PCL-Community:devfrom
qsc1918:aaa

Conversation

@qsc1918

@qsc1918 qsc1918 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

让内存管理可以设置初始大小和最大大小,启动游戏时jvm的Xms和Xmx用自定义设置
Close #3511
除简体中文外其他语言为机器翻译

Sourcery 摘要

允许用户为 Minecraft 启动配置初始和最大 JVM 堆大小。

新功能:

  • 为全局和实例级启动设置添加可配置的初始堆内存,并支持最大堆内存配置。
  • 在内存设置界面中显示配置的初始堆大小,并在启用后将其应用于 JVM 启动参数。

增强功能:

  • 保留固定内存行为,同时确保自定义初始内存不超过配置的最大内存。
Original summary in English

Sourcery 摘要

支持在现有最大堆内存设置的基础上,配置并应用初始 JVM 堆内存大小。

新功能:

  • 为全局和实例特定的启动设置添加可配置的初始 JVM 堆内存。
  • 将配置的初始堆内存大小应用于 Minecraft JVM 启动参数,并在内存设置界面中显示。

增强功能:

  • 保留固定内存行为,同时确保自定义初始堆内存不超过配置的最大堆内存大小。
Original summary in English

Sourcery 摘要

支持在现有最大内存设置的基础上,配置并应用自定义初始 JVM 堆大小。

新功能:

  • 为全局和特定实例的 Minecraft 启动设置添加可配置的初始 JVM 堆大小。
  • 将配置的初始堆大小应用到 Minecraft JVM 参数中,并在内存设置中显示。

增强功能:

  • 保留固定内存行为,并将自定义初始堆大小限制在已配置的最大堆大小以内。
  • 遵循用户提供的 -Xms 参数,使其优先于自动初始堆配置。
Original summary in English

Sourcery 摘要

允许 Minecraft 启动配置设置并应用自定义的 JVM 初始堆大小。

新功能:

  • 添加全局和实例级控件,用于配置 JVM 的初始堆大小以及最大堆大小。
  • 在内存设置中显示已配置的初始堆大小,并在启用后将其应用于 Minecraft 启动参数。

增强功能:

  • 保持固定内存行为,遵循用户明确提供的 -Xms 参数,并将自定义初始堆大小限制在已配置的最大值以内。
Original summary in English

Sourcery 摘要

支持为 Minecraft 启动配置可自定义的 JVM 初始堆大小,以及最大内存设置。

新功能:

  • 添加全局和实例级别的自定义 JVM 初始堆大小配置,并在启动 Minecraft 时应用该配置。
  • 在内存设置界面中显示生效的初始堆大小。

增强功能:

  • 保留固定内存行为,遵循显式自定义的 -Xms 参数,并将配置的初始堆大小限制为不超过最大堆大小。
  • 在全局设置和实例设置之间复用共享的内存比例转换逻辑。
Original summary in English

Summary by Sourcery

为 Minecraft 启动配置增加可自定义的 JVM 初始堆大小,并将其应用于全局和实例级启动设置。

New Features:

  • 为全局及实例级内存设置新增可配置的 JVM 初始堆大小。
  • 在游戏启动时应用配置的初始堆大小,并在内存设置界面显示生效值。

Enhancements:

  • 保留固定内存模式,并确保自定义初始堆大小不超过最大堆大小。
  • 尊重用户自定义的 -Xms 参数,并复用统一的内存刻度转换逻辑。
Original summary in English

Summary by Sourcery

为 Minecraft 启动配置增加可自定义的 JVM 初始堆大小,并将其应用于全局和实例级启动设置。

New Features:

  • 为全局及实例级内存设置新增可配置的 JVM 初始堆大小。
  • 在游戏启动时应用配置的初始堆大小,并在内存设置界面显示生效值。

Enhancements:

  • 保留固定内存模式,并确保自定义初始堆大小不超过最大堆大小。
  • 尊重用户自定义的 -Xms 参数,并复用统一的内存刻度转换逻辑。

@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: L PR 大小评估:大型 labels Aug 25, 2026
@sourcery-ai

sourcery-ai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

审查者指南

该 PR 为全局和实例级手动内存分配增加可选的初始堆大小配置,通过共享刻度换算与上限裁剪计算实际值,并在两套 JVM 启动参数路径中生成相应的 -Xms;固定堆和用户自定义 JVM 参数仍保持优先级。

可配置 JVM 初始堆大小的时序图

sequenceDiagram
    participant User
    participant PageSetupLaunch
    participant PageInstanceSetup
    participant ModLaunch
    participant JVM

    User->>PageSetupLaunch: Set CustomInitialMemorySize
    User->>PageInstanceSetup: Set CustomInitialMemorySize
    PageSetupLaunch->>PageSetupLaunch: GetInitialRam
    PageInstanceSetup->>PageInstanceSetup: GetInitialRam
    ModLaunch->>ModLaunch: SecretLaunchJvmArgs
    ModLaunch->>ModLaunch: McLaunchArgumentsJvmOld
    alt custom -Xms is configured
        ModLaunch->>JVM: Launch with -Xms and -Xmx
    else LockMemory is enabled
        ModLaunch->>JVM: Launch with -Xms equal to -Xmx
    else user supplied -Xms exists
        ModLaunch->>JVM: Launch with existing -Xms
    end
Loading

文件级变更

变更 详情 文件
增加可独立配置的初始堆内存设置,并将其纳入全局与实例级配置。
  • 新增初始堆大小配置项及对应的实例参数映射,默认值为未主动设置。
  • 在全局和实例内存设置页面增加初始内存滑块、启用状态同步、配置回填和显示文本。
  • 将内存滑块刻度到 GiB 的换算提取为共享方法,并在初始内存计算中限制其不超过最大堆。
PCL.Core/App/Config.cs
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml.cs
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs
在 JVM 启动参数生成中按内存模式追加自定义 -Xms,同时保留用户参数和固定堆模式的优先级。
  • 手动分配模式且用户未提供 -Xms 时,根据全局或实例设置追加初始堆参数。
  • 固定堆模式继续使用与 -Xmx 相同的 -Xms,并优先于自定义初始堆设置。
  • 兼容新旧 JVM 启动参数生成路径及 32 位 Java 的内存限制。
Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs
补充新内存设置相关的多语言界面文本。
  • 为中文及英文语言资源添加初始内存显示和设置文案。
PCL.Core/App/Localization/Languages/en-GB.xaml
PCL.Core/App/Localization/Languages/en-US.xaml
PCL.Core/App/Localization/Languages/zh-CN.xaml
PCL.Core/App/Localization/Languages/zh-TW.xaml

针对关联 issue 的评估

Issue 目标 已解决 说明
#3511 为全局启动设置和单个 Minecraft 实例设置增加可配置的初始内存大小(-Xms),并保留最大内存大小(-Xmx)的配置能力。
#3511 在内存设置界面中提供初始内存大小的配置控件、启用状态、当前值显示及多语言文本支持。
#3511 启动 Minecraft 时根据初始内存配置生成 -Xms 参数,同时确保其不超过最大内存,并维持固定内存模式和用户自定义 JVM 参数的现有行为。

可能关联的 issue


提示和命令

与 Sourcery 交互

  • 触发新的审查: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。也可以使用 @sourcery-ai issue 回复审查评论,以从中创建 issue。
  • 生成 pull request 标题: 在 pull request 标题的任意位置写入 @sourcery-ai,即可随时生成标题。也可以在 pull request 中评论 @sourcery-ai title,以随时生成或重新生成标题。
  • 生成 pull request 摘要: 在 pull request 正文中任意位置写入 @sourcery-ai summary,即可在指定位置生成 PR 摘要。也可以在 pull request 中评论 @sourcery-ai summary,以随时生成或重新生成摘要。
  • 生成审查者指南: 在 pull request 中评论 @sourcery-ai guide,以随时生成或重新生成审查者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,以解决所有 Sourcery 评论。如果你已经处理完所有评论并且不想再看到它们,这一功能会很有用。
  • 忽略所有 Sourcery 审查: 在 pull request 中评论 @sourcery-ai dismiss,以忽略所有现有的 Sourcery 审查。如果你想以新的审查重新开始,这一功能尤其有用——别忘了评论 @sourcery-ai review 来触发新的审查!

自定义使用体验

访问你的控制面板,以便:

  • 启用或禁用审查功能,例如 Sourcery 生成的 pull request 摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查指令。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

该 PR 为全局和实例级手动内存分配增加可选的初始堆大小配置,通过共享刻度换算与上限裁剪计算实际值,并在两套 JVM 启动参数路径中生成相应的 -Xms;固定堆和用户自定义 JVM 参数仍保持优先级。

Sequence diagram for configurable JVM initial heap size

sequenceDiagram
    participant User
    participant PageSetupLaunch
    participant PageInstanceSetup
    participant ModLaunch
    participant JVM

    User->>PageSetupLaunch: Set CustomInitialMemorySize
    User->>PageInstanceSetup: Set CustomInitialMemorySize
    PageSetupLaunch->>PageSetupLaunch: GetInitialRam
    PageInstanceSetup->>PageInstanceSetup: GetInitialRam
    ModLaunch->>ModLaunch: SecretLaunchJvmArgs
    ModLaunch->>ModLaunch: McLaunchArgumentsJvmOld
    alt custom -Xms is configured
        ModLaunch->>JVM: Launch with -Xms and -Xmx
    else LockMemory is enabled
        ModLaunch->>JVM: Launch with -Xms equal to -Xmx
    else user supplied -Xms exists
        ModLaunch->>JVM: Launch with existing -Xms
    end
Loading

File-Level Changes

Change Details Files
增加可独立配置的初始堆内存设置,并将其纳入全局与实例级配置。
  • 新增初始堆大小配置项及对应的实例参数映射,默认值为未主动设置。
  • 在全局和实例内存设置页面增加初始内存滑块、启用状态同步、配置回填和显示文本。
  • 将内存滑块刻度到 GiB 的换算提取为共享方法,并在初始内存计算中限制其不超过最大堆。
PCL.Core/App/Config.cs
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml.cs
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs
在 JVM 启动参数生成中按内存模式追加自定义 -Xms,同时保留用户参数和固定堆模式的优先级。
  • 手动分配模式且用户未提供 -Xms 时,根据全局或实例设置追加初始堆参数。
  • 固定堆模式继续使用与 -Xmx 相同的 -Xms,并优先于自定义初始堆设置。
  • 兼容新旧 JVM 启动参数生成路径及 32 位 Java 的内存限制。
Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs
补充新内存设置相关的多语言界面文本。
  • 为中文及英文语言资源添加初始内存显示和设置文案。
PCL.Core/App/Localization/Languages/en-GB.xaml
PCL.Core/App/Localization/Languages/en-US.xaml
PCL.Core/App/Localization/Languages/zh-CN.xaml
PCL.Core/App/Localization/Languages/zh-TW.xaml

Assessment against linked issues

Issue Objective Addressed Explanation
#3511 为全局启动设置和单个 Minecraft 实例设置增加可配置的初始内存大小(-Xms),并保留最大内存大小(-Xmx)的配置能力。
#3511 在内存设置界面中提供初始内存大小的配置控件、启用状态、当前值显示及多语言文本支持。
#3511 启动 Minecraft 时根据初始内存配置生成 -Xms 参数,同时确保其不超过最大内存,并维持固定内存模式和用户自定义 JVM 参数的现有行为。

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嘿——我发现了 1 个问题

面向 AI Agent 的提示
请处理本次代码审查中的评论:

## 单独评论

### 评论 1
<location path="Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs" line_range="244-249" />
<code_context>
+        var ramInitial = GetInitialRam(ModInstanceList.McMcInstanceSelected, false);
</code_context>
<issue_to_address>
**issue (broader_impact):** UI 会在分配模式为手动时启用自定义初始内存滑块,但启用固定内存模式(`LockMemory`)后,并不会禁用或重置该控件。在这种状态下,启动器始终输出与 `-Xmx` 相等的 `-Xms`,并忽略配置的初始内存值,因此 UI 允许编辑一个实际上不会生效的设置。

**触发条件:** 手动分配模式和 `LockMemory` 同时启用时。

**建议修复:** 在启用 `LockMemory` 时禁用初始内存控件,并在锁定内存复选框发生变化时刷新该控件的状态。
</issue_to_address>

Sourcery 评估

等待批准。 请先处理 1 个发现的问题。

阻塞性发现:Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs:249


Sourcery 对开源项目免费——如果您喜欢我们的审查结果,请考虑分享它们 ✨
请帮助我变得更有用!请在每条评论上点击 👍 或 👎,我会利用这些反馈来改进审查结果。
Original comment in English

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs" line_range="244-249" />
<code_context>
+        var ramInitial = GetInitialRam(ModInstanceList.McMcInstanceSelected, false);
</code_context>
<issue_to_address>
**issue (broader_impact):** The UI enables the custom initial-memory slider whenever the allocation mode is manual, but it does not disable or reset that control when fixed-memory mode (`LockMemory`) is enabled. In that state the launcher always emits `-Xms` equal to `-Xmx` and ignores the configured initial-memory value, so the UI permits editing a setting that has no effect.

**Triggers:** When manual allocation mode and `LockMemory` are both enabled.

**Suggested fix:** Disable the initial-memory control while `LockMemory` is enabled, and refresh that state whenever the lock-memory checkbox changes.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs:249


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c4d6ab4ba

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs Outdated
sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Aug 25, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a303e4502f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64c4db01aa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs Outdated
sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Aug 25, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cdaaf883ac

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// 若 dataList 中已存在 -Xms(例如用户自定义参数已设)则跳过,避免重复/冲突。
if (Config.Launch.LockMemory && !dataList.Any(d => d.Contains("-Xms", StringComparison.OrdinalIgnoreCase)))
dataList.Add("-Xms" + maxHeapArg + "m");
if (!dataList.Any(d => d.Contains("-Xms", StringComparison.OrdinalIgnoreCase)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply configured Xms over manifest defaults

For instances using the modern arguments.jvm format, McLaunchArgumentsJvmNew populates dataList from the version and inherited JSON before calling this method. If that manifest contains an -Xms default, this guard prevents the newly configured initial-memory value from being added even though HasCustomXms only treats the user's effective custom JVM arguments as an override; the settings UI therefore shows the configured value while launches continue using the manifest value. Distinguish user-supplied overrides from manifest defaults, or replace the manifest's -Xms when applying this setting.

Useful? React with 👍 / 👎.

@qiMengStars

Copy link
Copy Markdown
Member

锁定内存分配功能看起来有些多余,既然已经可以通过拖动条将两者调整到相同大小,又为什么要使用独立的设置项?

@qsc1918

qsc1918 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

你不要问我啊,我也不知道

@Chiloven945 Chiloven945 changed the title imp:内存管理可以设置初始大小和最大大小 feat: 内存管理可以设置初始大小和最大大小 Aug 26, 2026

@Chiloven945 Chiloven945 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请端正态度。

不要本地化字符串拼接本地化字符串,要么合并要么用分隔符分开。除此之外,zh-CN 请遵守 GB/T 15834-2011,不要在横排文本使用方形引号。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03ef196774

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +249 to +251
var suffixText = string.Join(", ",
(ramInitial.HasValue ? Lang.Text("Setup.Launch.Memory.InitialSuffix", Lang.Number(ramInitial.Value, "N1")) : null),
(ramGame != ramGameActual ? Lang.Text("Setup.Launch.Memory.AvailableSuffix", Lang.Number(ramGameActual, "N1")) : null));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter empty memory suffixes before joining

string.Join converts each null element to an empty string but still inserts the separator, so the default case where neither suffix applies produces ", " and renders every memory card as 4.0 GiB (, ); when only one suffix applies, it similarly leaves a leading or trailing comma. Filter out null values before joining (and apply the same correction to the mirrored instance-settings code).

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03ef196774

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +249 to +251
var suffixText = string.Join(", ",
(ramInitial.HasValue ? Lang.Text("Setup.Launch.Memory.InitialSuffix", Lang.Number(ramInitial.Value, "N1")) : null),
(ramGame != ramGameActual ? Lang.Text("Setup.Launch.Memory.AvailableSuffix", Lang.Number(ramGameActual, "N1")) : null));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter absent suffixes before joining

string.Join treats these null elements as empty strings but still emits the separator. Consequently, when neither suffix applies—the normal default with no custom initial heap and sufficient available memory—the label displays GiB (, ); when only one applies, it gets a leading or trailing comma. Filter out null entries before joining, and apply the same correction to the duplicated instance-page formatting.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97a529afba

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +196 to +198
<local:MySlider Grid.Row="3" Grid.Column="1" IsEnabled="False" x:Name="SliderRamInitialCustom"
Tag="LaunchRamCustomInitial" MaxValue="49" Value="0" Change="SliderChange"
ToolTip="{DynamicResource Setup.Launch.Memory.Initial.ToolTip}" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Let the initial-memory slider use the RAM-dependent maximum

On systems with more than 48 GiB of RAM, this hard cap prevents configuring -Xms above 48 GiB even though RefreshRam raises the maximum-memory slider beyond tick 49 (for example, tick 57 permits a 64 GiB -Xmx). Update this slider's MaxValue alongside SliderRamCustom.MaxValue, including the mirrored instance slider, so high-memory configurations can select an initial heap up to their configured maximum.

Useful? React with 👍 / 👎.

Comment thread PCL.Core/App/Localization/Languages/zh-CN.xaml Outdated
Comment thread PCL.Core/App/Localization/Languages/en-US.xaml
@qsc1918

qsc1918 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

谢谢,改了
原来的:
屏幕截图 2026-08-29 103122
现在的:
屏幕截图 2026-08-29 103244
引号也改了

@MoYuan-CN
MoYuan-CN requested a review from Chiloven945 August 29, 2026 13:07
@Chiloven945

Copy link
Copy Markdown
Member

这里都用小写应该就可以了

@qsc1918

qsc1918 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

原来那个英文就是都用的小写,不过后来我看了一些其他软件,基本上都是用大写的,我也不知道怎么用,要改可以随时改

@Chiloven945

Copy link
Copy Markdown
Member

原来那个英文就是都用的小写,不过后来我看了一些其他软件,基本上都是用大写的,我也不知道怎么用,要改可以随时改

PCL CE en-US 跟随 PCL-Language 非专有名词统一使用 Sentence case。

@qsc1918

qsc1918 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author
屏幕截图 2026-09-06 141043 屏幕截图 2026-09-06 141058

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: L PR 大小评估:大型 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C#]: 内存管理可以设置初始大小和最大大小

3 participants