mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-01-30 14:39:56 +08:00
feat(crash): detect memory exceeding.
This commit is contained in:
parent
dc4a791a9e
commit
5f98c8c8bb
@ -357,8 +357,8 @@ game.crash.reason.mod_resolution_missing=Game crashed because the mod that some
|
||||
game.crash.reason.mod_resolution_missing_minecraft=Game crashed because a mod is incompatible with current Minecraft version.\n%1$s requires Minecraft version %2$s。\nIf you want to keep the installed version of the mod, you should change the game version.\nIf you want to continue using current game version, you should reinstall a suitable mod.
|
||||
game.crash.reason.mod_resolution_mod_version=%1$s (Version: %2$s)
|
||||
game.crash.reason.mod_resolution_mod_version.any=%1$s (Any version)
|
||||
game.crash.reason.no_class_def_found_error=Game cannot run because of incomplete code.\nYour game may be missing a mod, or some mod files may be incomplete.\nYou may need to reinstall the game and mods, or ask for help.\nMissing %1$s
|
||||
game.crash.reason.no_such_method_error=Game cannot run because of incomplete code.\nYour game may be missing a mod, or some mod files may be incomplete.\nYou may need to reinstall the game and mods, or ask for help.
|
||||
game.crash.reason.no_class_def_found_error=Game cannot run because of incomplete code.\nYour game may be missing a mod, or some mod files may be incomplete, or some mods are incompatible with current game.\nYou may need to reinstall the game and mods, or ask for help.\nMissing %1$s
|
||||
game.crash.reason.no_such_method_error=Game cannot run because of incomplete code.\nYour game may be missing a mod, or some mod files may be incomplete, or some mods are incompatible with current game.\nYou may need to reinstall the game and mods, or ask for help.
|
||||
game.crash.reason.opengl_not_supported=Game cannot run because of a problem with your graphics driver.\nBecause OpenGL is not supported, are you in remote desktop or streaming mode? If yes, please use the original computer to start game.\nOr try to update your graphics driver to the latest version and restart game. If your computer has a discrete graphics, you need to check whether the game uses integrated/core graphics. If so, try to run HMCL and game using discrete graphics card. If you still have these problems, you may consider getting a new graphics card or a new computer.
|
||||
game.crash.reason.openj9=Game cannot run on OpenJ9 virtual machine, please switch to Hotspot Java virtual machine in the game settings and restart the game. If not, you can download it online.
|
||||
game.crash.reason.out_of_memory=Game cannot run because out of memory.\nThis may be due to too little memory allocation, or too many mods.\nYou can increase the game memory allocation in the game settings to allow the game running on larger memory.\nIf you still have these problems, you may need to change a better computer.
|
||||
|
@ -357,8 +357,8 @@ game.crash.reason.mod_resolution_missing=當前遊戲因為缺少 Mod 前置,
|
||||
game.crash.reason.mod_resolution_missing_minecraft=當前遊戲因為 Mod 和 Minecraft 遊戲版本不匹配,無法繼續運行。\n%1$s 需要 Minecraft %2$s 才能運行。\n如果你要繼續使用你已經安裝的 Mod,你可以選擇安裝對應的 Minecraft 版本;如果你要繼續使用當前 Minecraft 版本,你需要安裝對應版本的 Mod。
|
||||
game.crash.reason.mod_resolution_mod_version=%1$s (版本號 %2$s)
|
||||
game.crash.reason.mod_resolution_mod_version.any=%1$s (任意版本)
|
||||
game.crash.reason.no_class_def_found_error=當前遊戲因為代碼不完整,無法繼續運行。\n你的遊戲可能缺失了某個 Mod,或者某些 Mod 檔案不完整。\n你可能需要重新安裝遊戲和 Mod,或請求他人幫助。\n缺失:%1$s
|
||||
game.crash.reason.no_such_method_error=當前遊戲因為代碼不完整,無法繼續運行。\n你的遊戲可能缺失了某個 Mod,或者某些 Mod 檔案不完整。\n你可能需要重新安裝遊戲和 Mod,或請求他人幫助。
|
||||
game.crash.reason.no_class_def_found_error=當前遊戲因為代碼不完整,無法繼續運行。\n你的遊戲可能缺失了某個 Mod,或者某些 Mod 檔案不完整,或者 Mod 與遊戲的版本不匹配。\n你可能需要重新安裝遊戲和 Mod,或請求他人幫助。\n缺失:%1$s
|
||||
game.crash.reason.no_such_method_error=當前遊戲因為代碼不完整,無法繼續運行。\n你的遊戲可能缺失了某個 Mod,或者某些 Mod 檔案不完整,或者 Mod 與遊戲的版本不匹配。\n你可能需要重新安裝遊戲和 Mod,或請求他人幫助。
|
||||
game.crash.reason.opengl_not_supported=當前遊戲因為你的顯示卡驅動存在問題,無法繼續運行。\n原因是 OpenGL 不受支援,你現在是否在遠程桌面或者串流模式下?如果是,請直接使用原電腦啟動遊戲。\n或者嘗試升級你的顯示卡驅動到最新版本後再嘗試啟動遊戲。如果你的電腦存在獨立顯示卡,你需要檢查遊戲是否使用集成/核心顯示卡啟動,如果是,請嘗試使用獨立顯示卡啟動 HMCL 與遊戲。如果仍有問題,你可能需要考慮換一個新顯示卡或新電腦。
|
||||
game.crash.reason.openj9=當前遊戲無法運行在 OpenJ9 虛擬機上,請你在遊戲設置中更換 Hotspot Java 虛擬機,並重新啟動遊戲。如果沒有下載安裝,你可以在網路上自行下載。
|
||||
game.crash.reason.out_of_memory=當前遊戲因為記憶體不足,無法繼續運行。\n這可能是記憶體分配太小,或者 Mod 數量過多導致的。\n你可以在遊戲設置中調大遊戲記憶體分配值以允許遊戲在更大的記憶體下運行。\n如果仍然出現該錯誤,你可能需要換一台更好的電腦。
|
||||
|
@ -350,6 +350,7 @@ game.crash.reason.jdk_9=当前游戏因为 Java 版本过高,无法继续运
|
||||
game.crash.reason.jvm_32bit=如果你的电脑是 64 位系统,请下载安装并更换 64 位 Java。如果你的电脑室 32 位系统,你或许可以重新安装 64 位系统,或换一台新电脑。
|
||||
game.crash.reason.loading_crashed_forge=当前游戏因为模组 %1$s (%2$s) 错误,无法继续运行。\n你可以尝试删除或更新该模组以解决问题。
|
||||
game.crash.reason.loading_crashed_fabric=当前游戏因为模组 %1$s 错误,无法继续运行。\n你可以尝试删除或更新该模组以解决问题。
|
||||
game.crash.reason.memory_exceeded=当前游戏因为分配的内存过大,无法继续运行。\n该问题是由于系统页面文件太小导致的。\n你需要在游戏设置中关闭游戏内存的自动分配,并将游戏内存调低至游戏能正常启动为止。\n你还可以尝试调大系统的页面大小。
|
||||
game.crash.reason.mod=当前游戏因为 %1$s 的问题,无法继续运行。\n你可以更新或删除已经安装的 %1$s 再试。
|
||||
game.crash.reason.mod_resolution=当前游戏因为 Mod 依赖问题,无法继续运行。Fabric 提供了如下信息:\n%1$s
|
||||
game.crash.reason.mod_resolution_conflict=当前游戏因为 Mod 冲突,无法继续运行。\n%1$s 与 %2$s 不能兼容。
|
||||
@ -357,8 +358,8 @@ game.crash.reason.mod_resolution_missing=当前游戏因为缺少 Mod 前置,
|
||||
game.crash.reason.mod_resolution_missing_minecraft=当前游戏因为 Mod 和 Minecraft 游戏版本不匹配,无法继续运行。\n%1$s 需要 Minecraft %2$s 才能运行。\n如果你要继续使用你已经安装的 Mod,你可以选择安装对应的 Minecraft 版本;如果你要继续使用当前 Minecraft 版本,你需要安装对应版本的 Mod。
|
||||
game.crash.reason.mod_resolution_mod_version=%1$s (版本号 %2$s)
|
||||
game.crash.reason.mod_resolution_mod_version.any=%1$s (任意版本)
|
||||
game.crash.reason.no_class_def_found_error=当前游戏因为代码不完整,无法继续运行。\n你的游戏可能缺失了某个 Mod,或者某些 Mod 文件不完整。\n你可能需要重新安装游戏和 Mod,或请求他人帮助。\n缺失:%1$s
|
||||
game.crash.reason.no_such_method_error=当前游戏因为代码不完整,无法继续运行。\n你的游戏可能缺失了某个 Mod,或者某些 Mod 文件不完整。\n你可能需要重新安装游戏和 Mod,或请求他人帮助。
|
||||
game.crash.reason.no_class_def_found_error=当前游戏因为代码不完整,无法继续运行。\n你的游戏可能缺失了某个 Mod,或者某些 Mod 文件不完整,或者 Mod 与游戏的版本不匹配。\n你可能需要重新安装游戏和 Mod,或请求他人帮助。\n缺失:%1$s
|
||||
game.crash.reason.no_such_method_error=当前游戏因为代码不完整,无法继续运行。\n你的游戏可能缺失了某个 Mod,或者某些 Mod 文件不完整,或者 Mod 与游戏的版本不匹配。\n你可能需要重新安装游戏和 Mod,或请求他人帮助。
|
||||
game.crash.reason.opengl_not_supported=当前游戏因为你的显卡驱动存在问题,无法继续运行。\n原因是 OpenGL 不受支持,你现在是否在远程桌面或者串流模式下?如果是,请直接使用原电脑启动游戏。\n或者尝试升级你的显卡驱动到最新版本后再尝试启动游戏。如果你的电脑存在独立显卡,你需要检查游戏是否使用集成/核心显卡启动,如果是,请尝试使用独立显卡启动 HMCL 与游戏。如果仍有问题,你可能需要考虑换一个新显卡或新电脑。
|
||||
game.crash.reason.openj9=当前游戏无法运行在 OpenJ9 虚拟机上,请你在游戏设置中更换 Hotspot Java 虚拟机,并重新启动游戏。如果没有下载安装,你可以在网上自行下载。
|
||||
game.crash.reason.out_of_memory=当前游戏因为内存不足,无法继续运行。\n这可能是内存分配太小,或者 Mod 数量过多导致的。\n你可以在游戏设置中调大游戏内存分配值以允许游戏在更大的内存下运行。\n如果仍然出现该错误,你可能需要换一台更好的电脑。
|
||||
|
@ -47,6 +47,8 @@ public final class CrashReportAnalyzer {
|
||||
GRAPHICS_DRIVER(Pattern.compile("(Pixel format not accelerated|Couldn't set pixel format|net\\.minecraftforge\\.fml.client\\.SplashProgress|org\\.lwjgl\\.LWJGLException|EXCEPTION_ACCESS_VIOLATION(.|\\n|\\r)+# C {2}\\[(ig|atio|nvoglv))")),
|
||||
// Out of memory
|
||||
OUT_OF_MEMORY(Pattern.compile("(java\\.lang\\.OutOfMemoryError|The system is out of physical RAM or swap space)")),
|
||||
// Memory exceeded
|
||||
MEMORY_EXCEEDED(Pattern.compile("There is insufficient memory for the Java Runtime Environment to continue")),
|
||||
// Too high resolution
|
||||
RESOLUTION_TOO_HIGH(Pattern.compile("Maybe try a (lower resolution|lowerresolution) (resourcepack|texturepack)\\?")),
|
||||
// game can only run on Java 8. Version of uesr's JVM is too high.
|
||||
|
@ -230,6 +230,13 @@ public class CrashReportAnalyzerTest {
|
||||
CrashReportAnalyzer.Rule.OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void memoryExceeded() throws IOException {
|
||||
CrashReportAnalyzer.Result result = findResultByRule(
|
||||
CrashReportAnalyzer.anaylze(loadLog("/logs/memory_exceeded.txt")),
|
||||
CrashReportAnalyzer.Rule.MEMORY_EXCEEDED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void config() throws IOException {
|
||||
CrashReportAnalyzer.Result result = findResultByRule(
|
||||
|
23
HMCLCore/src/test/resources/logs/memory_exceeded.txt
Normal file
23
HMCLCore/src/test/resources/logs/memory_exceeded.txt
Normal file
@ -0,0 +1,23 @@
|
||||
[19:39:13] [main/INFO]: Loading tweak class name optifine.OptiFineTweaker
|
||||
[19:39:13] [main/INFO]: Using primary tweak class name optifine.OptiFineTweaker
|
||||
[19:39:13] [main/INFO]: Calling tweak class optifine.OptiFineTweaker
|
||||
OptiFineTweaker: acceptOptions
|
||||
OptiFineTweaker: injectIntoClassLoader
|
||||
OptiFine ClassTransformer
|
||||
OptiFine ZIP file: D:\我的世界\minecraft\.minecraft\libraries\optifine\OptiFine\1.16.4_HD_U_G7\OptiFine-1.16.4_HD_U_G7.jar
|
||||
OptiFineTweaker: getLaunchArguments
|
||||
OptiFineTweaker: getLaunchTarget
|
||||
[19:39:13] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main}
|
||||
[19:39:14] [main/INFO]: [OptiFine] (Reflector) Field not found: World.tileEntitiesToBeRemoved
|
||||
[19:39:14] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.eventbus.api.Event$Result
|
||||
[19:39:14] [main/INFO]: [OptiFine] (Reflector) Method not present: net.minecraftforge.common.extensions.IForgeBlockState.hasTileEntity
|
||||
[19:39:14] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.extensions.IForgeEntity
|
||||
[19:39:14] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.CrashReportExtender
|
||||
[19:39:19] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.ForgeHooksClient
|
||||
[19:39:20] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
|
||||
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000007b4000000, 50331648, 0) failed; error='页面文件太小,无法完成操作。' (DOS error/errno=1455)
|
||||
#
|
||||
# There is insufficient memory for the Java Runtime Environment to continue.
|
||||
# Native memory allocation (mmap) failed to map 50331648 bytes for Failed to commit area from 0x00000007b4000000 to 0x00000007b7000000 of length 50331648.
|
||||
# An error report file with more information is saved as:
|
||||
# D:\我的世界\minecraft\.minecraft\hs_err_pid1224.log
|
Loading…
Reference in New Issue
Block a user