Skip to content

Detect out of memory errors on all server software - #227

Merged
pavog merged 1 commit into
masterfrom
paper-out-of-memory-error
Nov 17, 2026
Merged

pavog merged 1 commit into
masterfrom
paper-out-of-memory-error

Conversation

@pavog

@pavog pavog commented Nov 17, 2026

Copy link
Copy Markdown
Member
[15:50:02] [Worker-Main-5/ERROR]: Caught exception in thread Thread[#63,Worker-Main-5,5,main]
java.lang.OutOfMemoryError: Java heap space
java.util.concurrent.CompletionException: java.lang.OutOfMemoryError: Metaspace

When Java runs out of memory in the heap or in the Metaspace, the server crashes or stops working.
This was not detected before, neither in server logs nor in crash reports.

This PR adds OutOfMemoryErrorProblem to the VanillaAnalyser and the MinecraftCrashReportAnalyser, because it is a Java error that can happen on all server software.
The memory area is passed to the message as Java logs it (Java heap space or Metaspace), because it is a technical term that is not translated.

The solutions depend on the server software, so a Vanilla server is not told to remove plugins.
The analysers replace the problem with a child class through overridePossibleInsightClass(), like they already do for VanillaVersionInformation:

Class Solutions Analysers
OutOfMemoryErrorProblem more memory Vanilla, Vanilla crash reports
PluginOutOfMemoryErrorProblem + remove plugins Bukkit and its children, Paper crash reports
ModOutOfMemoryErrorProblem + remove mods Forge, NeoForge, Fabric, Quilt and their crash reports
HybridOutOfMemoryErrorProblem + remove mods and plugins Forge/Bukkit hybrids like Arclight and Mohist

ModOutOfMemoryErrorProblem is in the Vanilla namespace, because the mod loaders share it and have no common parent.
Spigot, Purpur and Folia crash reports still use the generic crash report analyser and only get the Vanilla solution.

Other kinds of OutOfMemoryError, like unable to create native thread, are intentionally not matched, because they have other causes.
There is no real log of a mod loader running out of memory yet, so the mod variants are only covered by the analyser registration.

Changes

  • add OutOfMemoryErrorProblem, PluginOutOfMemoryErrorProblem, ModOutOfMemoryErrorProblem and HybridOutOfMemoryErrorProblem
  • add IncreaseMemorySolution, PluginMemoryUsageSolution and ModMemoryUsageSolution
  • override the problem in the Bukkit, Forge, NeoForge, Fabric, Quilt and hybrid analysers and in their crash report analysers
  • add translations for the problem and the three solutions
  • add paper-out-of-memory-error-26-3.log and vanilla-out-of-memory-error-26-3.log

Changed test expectations

  • paper-metaspace now reports the Metaspace error, where it reported no problem before

@pavog
pavog requested a review from JulianVennen November 17, 2026 15:00
@pavog
pavog merged commit b9e7b7b into master Nov 17, 2026
3 checks passed
@pavog
pavog deleted the paper-out-of-memory-error branch November 17, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants