重要提示:
本模组并非适合所有人!
仅当您遇到由大量内存占用引起的卡顿(通常出现在大型整合包中)或因 OutOfMemoryError 导致的崩溃时,才建议使用此模组。
否则,本模组会对您的游戏体验产生负面影响,因为显式垃圾回收需要时间,而在内存充裕的情况下并不会带来任何益处。
为了获得最佳体验,我建议使用推荐的 JVM 参数,详见下文。
仅客户端模组
本模组会自动调用 System.gc() 以释放内存。由于显式垃圾回收可能导致游戏短暂冻结,本模组会监控玩家移动状态,在玩家闲置一段时间后开始清理内存。
当你的内存使用率超过一定百分比(可配置)时,或者在长时间未满足上述条件后(同样可配置),内存清理过程也会启动。
此外,你还可以使用 /cleanmemory 命令立即释放内存。
更多选项可以在游戏内的模组设置中查看。
注意,不要将 -XX:+DisableExplicitGC包含在您的 JVM 参数中,因为启用该参数后模组将无法正常运行。
如果你不希望清理内存时游戏卡死,可以尝试以下 JVM 参数:(-Xmx 和 -Xms 的值已省略)
-XX:+AggressiveOpts -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSConcurrentMTEnabled -XX:ParallelGCThreads=4 -Dsun.rmi.dgc.server.gcInterval=1800000 -XX:+UnlockExperimentalVMOptions -XX:+ExplicitGCInvokesConcurrent -XX:MaxGCPauseMillis=50 -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:-OmitStackTraceInFastThrow -XX:+OptimizeStringConcat -XX:+UseAdaptiveGCBoundary -XX:NewRatio=3 -Dfml.readTimeout=90 -XX:+UseFastAccessorMethods
此功能启用并发显式垃圾回收,使游戏在内存清理过程中不会卡顿。JVM 参数选项可在你的 Minecraft 启动器中找到。
IMPORTANT:
THIS MOD IS NOT FOR EVERYONE!
Only use this if you are experiencing lag caused by high RAM usage (Which usually happens on very large modpacks) or experiencing crashes caused by OutOfMemoryError.
Otherwise this mod will negatively affect your game experience, because explicit gc takes time and it brings no benefit if your RAM is abundant.
For best experience I recommend using the suggested JVM arguments, see below.
CLIENT ONLY MOD
This mod automatically calls System.gc() to free up your memory. Due to the fact that explicit gc can freeze your game for a short period, the mod watches the player movement and starts to clean up your RAM after the player stays idle for a while.
The memory cleaning process also starts when your RAM usage goes above a certain percent (configurable) or after a long period if none of the above conditions are met (also configurable).
Also you can use the /cleanmemory command to free up your RAM immediately.
More options can be seen in the in-game mod settings.
Note that do NOT include -XX:+DisableExplicitGC in your JVM arguments because the mod will not function at all with it.
If you don't want your game to freeze when cleaning memory, you should try these JVM arguments: (-Xmx and -Xms values are omitted)
-XX:+AggressiveOpts -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSConcurrentMTEnabled -XX:ParallelGCThreads=4 -Dsun.rmi.dgc.server.gcInterval=1800000 -XX:+UnlockExperimentalVMOptions -XX:+ExplicitGCInvokesConcurrent -XX:MaxGCPauseMillis=50 -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:-OmitStackTraceInFastThrow -XX:+OptimizeStringConcat -XX:+UseAdaptiveGCBoundary -XX:NewRatio=3 -Dfml.readTimeout=90 -XX:+UseFastAccessorMethods
This enables concurrent explicit gc so that your game will not freeze during memory cleanings. The JVM arguments options should be found in your Minecraft launcher.
评论 0
登录后参与评分
还没有评论,来抢沙发吧