LogoLogo
WEBDASHPANELDOCSCHATSTATUS
English
English
  • πŸŽ‰Welcome
    • πŸ””Newsletter
  • 🌍HidenCloud Documentation
  • HidenCloud Dashboard
    • πŸ”“Enable Two-Factor Authentication (2FA)
    • βž•Extra/Additional services
    • 🎫How to open a ticket?
    • πŸ’΅How to buy?
    • πŸ’³Payment Methods
    • 🟒Status and behavior of services
    • πŸ”΄Delete account
    • 😑Server Deleted or Account Restricted?
    • 🌐SubDomain
    • πŸ’»VPS
    • ❌Cancel Your Service
    • πŸ—ΊοΈChange Location
    • *️Update Your HidenCloud Account Details
  • HidenCloud Panel
    • β›…Guide for beginners
    • πŸ”“How to get into my server?
    • πŸ—ƒοΈAdd files
    • πŸ“‚Backups
    • πŸ“‘Databases
    • πŸ«‚Adding Sub-Users
    • ⏰How to create a task?
    • πŸ› οΈHow to enable Toggle Support OP Access?
    • πŸ”ŒHigh Ping and Packet Loss
    • πŸ‘ΏServer Crashes
    • ⁉️Errors
    • πŸ†”Server UUID
  • 🌐Reverse Proxy
  • Minecraft
    • πŸ› οΈChange Java version
    • πŸ”’Change Minecraft Type and Version
    • πŸ”ƒServer Restarting / killed?
    • πŸ”’Change JVM Startup Flags
    • πŸ”‚Version Compatibility in Minecraft with ViaVersion Plugins
    • πŸ‘₯Online Mode
    • πŸ› οΈHow to install a plugin / mod?
    • πŸ‘€Security Plugins
    • ⚑Server Optimization Guide
      • πŸ› οΈDownload optimization plugins
      • πŸ› οΈServer Configuration
      • πŸ› οΈHelpers and Java Flags
        • ⚑Minecraft exploit and how to fix them
    • πŸ›œInstalling Bungeecord
      • πŸ› οΈConfigure a Bungeecord server
    • 😍Adding an Icon to the Server
    • ✍️Adding a Description to the Server
    • πŸ“¦Add a Resource Pack
    • ⁉️Common Errors
  • ARK:Survival Evolved
    • πŸ”ŒWhat is GameUserSettings.ini?
    • πŸ” How to Find Your Tribe or Player ID
  • Windows Tutorials
    • β˜•Java Local Binary
  • Free
    • 🀩Free Tier
  • GAME-SERVER PAID PLAN
    • 🌻Budget_Game-Servers
    • πŸ€Budget_Software-Servers
    • πŸ’ŽPremium_Game-Servers
    • βž•Extras
  • VPS PAID PLAN
    • πŸ’»VPS-Servers
    • πŸ–₯️VPS-Custom
  • Discord
    • 🚫Rules
    • πŸ€–/suggest command
    • 🎟️How to create a ticket?
    • πŸ”±Client Role
  • Information
    • ℹ️Contact and Help
    • 🌐Social Networks
    • ⚜️Partnership
    • πŸ‘¨β€πŸ’ΌStaff Application
    • πŸ’°Donate
    • ❓FAQ's
    • ❀️HidenNetwork
  • Legal
    • πŸ’ΎTerms of Service
    • πŸ”Privacy Policy
    • πŸͺCookies Policy
Powered by GitBook
LogoLogo

Services

  • Minecraft
  • Discord Hosting
  • Free
  • Rust

Company

  • About
  • Blog
  • News
  • HidenNetwork

Support

  • Contact
  • Discord
  • System Status
  • Documentation

Legal

  • Terms
  • Privacy Policy
  • Cookies Policies

Copyright Β© 2024 HidenCloudβ„’ - All rights reserved. | E: info@hidencloud.com | T/WA: +34930414115

On this page
  • Understanding the Issue: Out of Memory Error and Server Restarts
  • The OOM Killer
  • SERVER_MAX_RAM Variable
  • Recommended Configuration
  • If the Issue Persists
  • Final Recommendations

Was this helpful?

Export as PDF
  1. Minecraft

Server Restarting / killed?

Handling Server Restarts and Memory Issues. Server Restarting: OutOfMemory = true

PreviousChange Minecraft Type and VersionNextChange JVM Startup Flags

Last updated 4 months ago

Was this helpful?

Understanding the Issue: Out of Memory Error and Server Restarts

At HidenCloud, we prioritize the smooth operation and reliability of your server. However, you may occasionally encounter server restarts due to an "Out of Memory" (OOM) error. This is commonly related to the way Java, the programming language used by many applications including Minecraft, manages memory.

The OOM Killer

A critical system component to understand is the OOM Killer. This is a mechanism in the Linux operating system, which HidenCloud servers utilize, designed to handle low memory situations. When your server consumes all available memory, the OOM Killer is triggered to free up resources. It does this by terminating processes, which can unfortunately include your server, leading to restarts.

Adjusting Memory Settings to Prevent OOM

To mitigate this issue, it’s essential to configure your server's memory settings correctly. Java, by default, can use all available memory, which might trigger the OOM Killer. You can adjust these settings through two key parameters:

  • Xms (Initial Memory Allocation): This setting determines the initial amount of memory Java allocates on startup. (You can't modify this)

  • Xmx (Maximum Memory Allocation): This is the maximum amount of memory Java is allowed to use. (You can modify this)

You can modify the server RAM (Xmx) through: Server -> Configuration -> Startup Parameters -> SERVER_MAC_RAM Variable.

SERVER_MAX_RAM Variable

The SERVER_MAX_RAM parameter in HidenCloud controls the maximum RAM allocated to Java servers, impacting the Garbage Collector (GC) performance. By default, it is set to "total server RAM - 512MB" to reserve some memory for system processes. Setting this value too high can lead to longer GC pauses, while too low can cause more frequent GC runs, both affecting performance. It should not exceed the RAM allocated to your server, as this may trigger the OOM Killer and stop the server.

To set this variable, YOU MUST FOLLOW THE FOLLOWING SCHEME: -Xmx{RAM_in_megabytes}M. For example: -Xmx2048M.

You need to leave a minimum difference of 512MB or an optimal difference of 1500MB for Java to use as a buffer or for garbage collection. For example, if you have a server with 2GB of RAM, which is equivalent to 2048MB, and you set the SERVER_MAX_RAM variable to -Xmx1024M (1GB), you will notice that the server can reach up to 1500MB of usage. This happens because Java uses the additional space as a buffer. The buffer space allows Java to manage memory more efficiently, allocating ram for temporary data and garbage collection processes. This buffer is crucial for the smooth operation of Java applications, as it helps to prevent out-of-memory errors by providing a cushion of available memory that Java can utilize for managing temporary and unneeded data.

Recommended Configuration

When configuring these settings, it's crucial to allocate less memory than the total available on your server. For example, if your server has 8000M of memory:

  • Do Not Allocate the Full 8000M to Java: This leaves no memory for other essential system processes, risking an OOM situation.

  • Allocate Around 6500M for Java: This creates a buffer of approximately 1500M, ensuring there is memory available for the operating system and other processes.

This configuration helps in preventing the server from using all available RAM, reducing the likelihood of the OOM Killer being activated.

If the Issue Persists

If your server continues to experience restarts due to memory issues:

  • Consider upgrading your plan to one that has more ram.

  • Disabling the OOM Killer: As a last resort, HidenCloud support can disable the OOM Killer for your server. However, this is generally not recommended as it can lead to system instability.

Final Recommendations

  • Regularly monitor your server’s memory usage.

  • Consult with HidenCloud support for optimal memory settings.

  • Consider upgrading your server plan if memory issues persist.

By following these guidelines and adjusting your server’s memory settings, you can significantly reduce the occurrence of "Out of Memory" errors and server restarts, ensuring a smoother and more reliable experience on HidenCloud.

Contact HidenCloud Support: Our team can assist you with further troubleshooting and configuration.

πŸ”ƒ
HidenCloud Support
Server -> System -> Audit Logs -> OutOfMemory = true
Server -> Configuration -> Startup Parameters