この記事について※回答10秒
ふる
目次
メモリ不足が原因!Java版マイクラサーバーエラー:Exception: java.lang.OutOfMemoryError
~/MohistMC$ java -Xms1G -Xmx4G -jar mohist-1.18.2-90-server.jar
__ __ ______ __ __ __ ______ ______
/\ "-./ \ /\ __ \ /\ \_\ \ /\ \ /\ ___\ /\__ _\
\ \ \-./\ \\ \ \/\ \\ \ __ \\ \ \\ \___ \\/_/\ \/
\ \_\ \ \_\\ \_____\\ \_\ \_\\ \_\\/\_____\ \ \_\
\/_/ \/_/ \/_____/ \/_/\/_/ \/_/ \/_____/ \/_/
Welcome to Mohist ! - Mohist Developement Group
Checking libraries, please wait...
:
:
:
[Mohist] Creating forge server jar. This can take 1 minute.
Finished the install verification process !
__ __ ______ __ __ __ ______ ______
/\ "-./ \ /\ __ \ /\ \_\ \ /\ \ /\ ___\ /\__ _\
\ \ \-./\ \\ \ \/\ \\ \ __ \\ \ \\ \___ \\/_/\ \/
\ \_\ \ \_\\ \_____\\ \_\ \_\\ \_\\/\_____\ \ \_\
\/_/ \/_/ \/_____/ \/_/\/_/ \/_/ \/_____/ \/_/
Welcome to Mohist ! - Mohist Developement Group
Update in check...
If you don't want to enable update check, set check_update in mohist-config/mohist.yml to false
No update found, latest version: (1.18.2-90-1.18.2-90) current version: (1.18.2-90-{2})
You need to accept the eula to launch your server. Type true to continue.
true
cpw.mods.cl.ModuleClassLoader@69c81773
[20:55:02] [INFO]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 40.1.73, --fml.mcVersion, 1.18.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220404.173914]
:
:
:
[20:55:22] [ERROR]: Failed to load properties from file: server.properties
:
:
:
[20:55:31] [WARN]: Incorrect key server.permissionHandler was corrected from null to its default, forge:default_handler.
[20:55:31] [INFO]: Preparing level "world"
[20:55:34] [WARN]: Failed to process update information
java.net.http.HttpConnectTimeoutException: HTTP connect timed out
at jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:567) ~[java.net.http:?] {}
at jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:123) ~[java.net.http:?] {}
at net.minecraftforge.fml.VersionChecker$1.openUrlString(VersionChecker.java:131) ~[fmlcore-1.18.2-40.1.73.jar%2356!/:?] {}
at net.minecraftforge.fml.VersionChecker$1.process(VersionChecker.java:169) ~[fmlcore-1.18.2-40.1.73.jar%2356!/:?] {}
at java.lang.Iterable.forEach(Iterable.java:75) [?:?] {}
at net.minecraftforge.fml.VersionChecker$1.run(VersionChecker.java:114) [fmlcore-1.18.2-40.1.73.jar%2356!/:?] {}
Caused by: java.net.http.HttpConnectTimeoutException: HTTP connect timed out
at jdk.internal.net.http.ResponseTimerEvent.handle(ResponseTimerEvent.java:68) ~[java.net.http:?] {}
at jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(HttpClientImpl.java:1270) ~[java.net.http:?] {}
at jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:899) ~[java.net.http:?] {}
Caused by: java.net.ConnectException: HTTP connect timed out
at jdk.internal.net.http.ResponseTimerEvent.handle(ResponseTimerEvent.java:69) ~[java.net.http:?] {}
at jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(HttpClientImpl.java:1270) ~[java.net.http:?] {}
at jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:899) ~[java.net.http:?] {}
[20:56:28] [INFO]: Preparing start region for dimension minecraft:overworld
>
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Worker-Bootstrap-1"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Server thread"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-0"
~/MohistMC$
マイクラのサーバー起動中にException: java.lang.OutOfMemoryError
が表示されて落ちる場合はマシンのメモリ不足が原因です。
ちなみに途中に表示される[20:55:22] [ERROR]: Failed to load properties from file: server.properties
は気にしなくて良いエラーです。
サーバー起動コマンドでは~/MohistMC$ java -Xms1G -Xmx4G -jar mohist-1.18.2-90-server.ja
で最大4GBまで割り当てる設定で起動していますが、Ubuntuマシン自体は2GBでした。
※僕の環境ではUbuntuを仮想環境で起動しています。
このため、5GBにしてサーバーを再度起動しなおしたら起動コマンドは通りました。
OpenJDKのバージョンは関係ないので注意
M1・M2 Mac でITスキル向上「とりあえず、マイクラ鯖を立てよう」!
M1・M2 Mac でマイクラ鯖を構築すれば簡単にITスキルが向上します。マイクラ鯖を構築するだけでネットワークどころか会社で使える実用技術を芋づる式で獲得できます。
しかも、"Parallels"の仮想環境で作業するので"買いたてホヤホヤ"の新品Macの環境を一切汚しません。
M1・M2 Macを使う人はWindows仮想環境を構築するはずなので、どちらにしろ"Parallels"を必ず使うと思います。
Parallelsでマイクラ鯖
- Ubuntu 22.04 LTS ARM64のLinux仮想環境
- Linuxコマンド
- Git
- 仮想環境のネットワーク知識
- 仮想環境はDockerにも応用
仮想環境なので何度でもスクラップできるのがメリットです。
特に、エンジニアの方にオススメです。
M1・M2 Macでの開発はParallels仮想環境でやりましょう!メインPCで開発するのは環境汚染です!
模範回答
あわせて読みたい

【無料】M2 MacのParallels(Ubuntu)で統合版マイクラサーバーを立てる!
M2 MacにParallels+Ubuntu 22.04でマインクラフト統合版サーバーを構築! 【【疑問】どうしてM2 MacにParallels仮想環境を構築するのか?】 この記事では、M2 MacにPar...
あわせて読みたい

【無料】M1・M2 MacのParallels(Windows11)に統合版マイクラサーバーを立てる!
M1・M2 MacにParallels+Windowsでマインクラフト統合版サーバーを構築! 【M1・M2 Macで統合版マイクラ鯖を立てる際に知っておくこと】 今回は、M1・M2 Mac(ARM64)環...
コメント