This plugin adds the /heapdump command to your server, it requires the permission heapdump
which is given
to OP players by default.
The command takes a memory heap dump and saves it as a file in the server's directory. The file name uses the current system time by default, but you can customize it by command argument.
Be aware that the heap dump files are usually very big since it will dump the entire application memory in use in a single file, this means that if your server is using 4GB of RAM when the command is executed, the file will also take 4GB in the disk space.
Also be aware that heap dump files may contains sensitive information, like database connection information and unencrypted passwords, so never leave the dumps there.
Command | Permission | Usage | Description |
---|---|---|---|
/heapdump |
heapdumper.heapdump |
/heapdump <optional-filename> |
Take a heap dump to analyze memory leak issues and save in the server's folder |
/cleardump |
heapdumper.cleardump.single |
/cleardump <filename> |
Deletes a specific heap dump file |
/clearalldumps |
heapdumper.cleardump.all |
/clearalldumps |
Deletes all heap dump files at once |
heapdumper.cleardump.*
- Allows the user to run the command that clears the dumpsheapdumper.cleardump.single
heapdumper.cleardump.all
heapdumper.*
- Allows the user to run all the heapdumper commandsheapdumper.heapdump
heapdumper.cleardump.*
- Just do a normal
git clone https://github.com/PowerNukkit/HeapDumper-Plugin.git
(or the URL of your own git repository) - Import the
pom.xml
file with your IDE, it should do the rest by itself
- Create a zip file containing only your
plugin.yml
file - Rename the zip file to change the extension to jar
- Create an empty folder anywhere, that will be your server folder.
Note: You don't need to place the PowerNukkit jar in the folder, your IDE will load it from the maven classpath. - Create a folder named
plugins
inside your server folder
Note: It is needed to bootstrap your plugin, your IDE will load your plugin classes from the classpath automatically, so it needs to have only theplugin.yml
file. - Move the jar file that contains only the
plugin.yml
to theplugins
folder - Create a new Application run configuration setting the working directory to the server folder and the main class to:
cn.nukkit.Nukkit
- Now you can run in debug mode. If you change the
plugin.yml
you will need to update the jar file that you've made.