MemCheck 1.02

Output CraftBukkit/Spigot memory statistics

  1. Bobcat00
    Native Minecraft Version:
    Tested Minecraft Versions:
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    • 1.17
    • 1.18
    Source Code:

    Want to find out how much heap space your server really needs? Want to check that your hosting provider is giving you what you paid for? Other plugins, such as Essentials, will provided memory statistics, but they're probably not what you really want to know. MemCheck provides the amount of heap used and the total amount of free heap space in real time.

    MemCheck adds a /mem command which outputs the amount of used heap in MB and as a percentage of the maximum heap size, and the total free heap in MB. It also provides statistics about the Java "Metaspace" use. As a bonus, the server's current TPS as calculated by Essentials, the CPU load, the average garbage collection time in the previous minute, and the total number of loaded chunks are shown.

    At startup, the number of processors (threads), total physical memory, maximum heap, server view distance, Java garbage collector name(s), and Java command line options are written to the server log file.

    This allows the server owner to see how much memory is being used and if the memory available for additional objects is too small, too big, or just right.


    I discovered that the memory values reported by Essentials come directly from Java, and don't really show what a server owner needs to know. The explanation will be easier with the help of the following diagram I stole from Stackoverflow:


    Java provides, and Essentials reports, the three values shown in red. This is not really what a server owner needs. The more relevant values are the two shown in blue at the bottom: used, which is the amount of the heap currently used by the program, and totalFree, which is the amount of memory available for additional objects on the heap. More information is shown below.


    /mem - This outputs the current memory statistics. Note that the heap is constantly changing, so you'll see the values change from second to second, as more objects are allocated or the Java garbage collector runs.


    The output includes the following:
    • General:
      • TPS - If you're also running Essentials, the current TPS will be output.
      • CPU - The current CPU load as a percentage of all available cores.
      • GC - The average time needed to run the garbage collector, updated once per minute.
      • Chunks - The total number of loaded chunks from all worlds.
    • Heap:
      • Heap used - The current amount of heap space used by your server.
      • Free - The amount of additional heap space available, up to the maximum allowed.
      • Alloc - The amount of heap space currently allocated. This is useful if you specify an -Xms values that is less than -Xmx. It tells you how much heap space Java thinks is necessary.
    • Metaspace:
      • Metaspace used - The current amount of Metaspace used by your server.
      • Free - If a maximum value for the Metaspace has been given, this shows the amount which is free.
      • Alloc - The amount of Metaspace currently allocated.

    memcheck.mem - Required to use the mem command. Defaults to op.




    This plugin uses the bStats metrics system to provide anonymous usage data. You may opt-out globally by changing plugins/bStats/config.yml. The metrics are available at

    Cerus and Resoluciones like this.