Celeb Glow
news | March 14, 2026

How to get memory usage of a Minecraft server?

I am creating a Minecraft control panel at the moment and having trouble by getting the memory usage of the process.

My current process:

  • launch the server in a screen
  • get the pid of the screen
  • fetch amount of ram with command ps -p <pid> -o %mem

The error is, that it is always showing me a usage of 0.0 KB

I'm using Debian Linux.

Any ideas?

3

1 Answer

That's because the pid that you're searching is the pid of screen. The minecraft jar should have a ppid (parent pid) of the screen, so run:

ps -el | grep <pid of screen>

you should get something like:

root@ubuntu:~# ps -el | grep 26270
5 S 0 26270 1 0 80 0 - 6797 poll_s ? 00:00:00 screen
4 S 0 26271 26270 49 80 0 - 1026274 futex_ pts/0 00:00:15 java

where 26271 is the pid of the process inside of the screen

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy