【解決】Java版マイクラサーバーエラー:Exception: java.lang.OutOfMemoryError【OpenJDK】●

  • URLをコピーしました!
Java版マイクラ「MohistMC」自宅サーバーを構築!
Java版マイクラ「MohistMC」自宅サーバーを構築!
目次

メモリ不足が原因!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のバージョンは関係ないので注意

コメント

コメントする

目次