Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 打包过长的日志会造成 java.lang.OutOfMemoryError #3400

Open
ZekerZhayard opened this issue Oct 27, 2024 · 2 comments · May be fixed by #3468
Open

[Bug] 打包过长的日志会造成 java.lang.OutOfMemoryError #3400

ZekerZhayard opened this issue Oct 27, 2024 · 2 comments · May be fixed by #3468
Assignees
Labels

Comments

@ZekerZhayard
Copy link
Contributor

平台 | Platform

/

问题描述 | Problem Description

  1. 先搞个报错,其中包含很长的 debug.log
  2. 导出游戏崩溃信息
  3. 结果发现 debug.log 没有打包进去

启动器崩溃报告 / 启动器日志文件 | Launcher Crash Report / Launcher Log File

https://paste.ubuntu.com/p/8jfRy3crPX/

java.lang.OutOfMemoryError: Java heap space
	at java.lang.StringCoding.decode(StringCoding.java:215)
	at java.lang.String.<init>(String.java:463)
	at java.lang.String.<init>(String.java:515)
	at org.jackhuang.hmcl.util.io.FileUtils.readText(FileUtils.java:132)
	at org.jackhuang.hmcl.game.LogExporter.processLogs(LogExporter.java:97)
	at org.jackhuang.hmcl.game.LogExporter.lambda$exportLogs$0(LogExporter.java:68)
	at org.jackhuang.hmcl.game.LogExporter$$Lambda$826/1017533516.run(Unknown Source)
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640)
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
@Glavo
Copy link
Member

Glavo commented Oct 27, 2024

这个 debug.log 超过 1G 了吗?

@Glavo Glavo self-assigned this Oct 27, 2024
@burningtnt
Copy link
Member

burningtnt commented Oct 27, 2024

这里的实现原来是完整读入再写出去的,会有三个副本(原,StringBuilder 扩容中的两个),因此一旦超过 300M 就会炸

burningtnt added a commit to burningtnt/HMCL that referenced this issue Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants