Skip to content

Lightweight Hytale server plugin for automatic garbage collection at configurable intervals

License

Notifications You must be signed in to change notification settings

zuedev/HytaleSystemGC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HytaleSystemGC

Java License Build

A lightweight Hytale server plugin that automatically triggers garbage collection at configurable intervals to help manage memory usage.

✨ Features

  • 🔄 Automatic scheduled garbage collection - Set it and forget it
  • ⚙️ Configurable interval timing - Customize GC frequency to your needs
  • 📊 Smart logging - Only logs when significant memory (>1MB) is reclaimed
  • 🪶 Minimal overhead - Uses daemon threads for zero impact on server shutdown

📋 Requirements

  • Java 17 or higher
  • Maven 3.6+ (for building)
  • Hytale server with plugin support

🚀 Installation

From Release

  1. Download the latest release JAR from the Releases page
  2. Place the JAR in your server's earlyplugins folder
  3. Restart the server

Building from Source

# Clone the repository
git clone https://github.com/zuedev/HytaleSystemGC.git
cd HytaleSystemGC

# Build with Maven
mvn clean package

# The JAR will be in target/HytaleSystemGC-1.0.0.jar

⚙️ Configuration

The plugin can be configured by modifying the GCConfig class or programmatically at runtime:

Setting Default Description
autoGcIntervalSeconds 10 Seconds between GC runs (0 to disable)
minMemoryThresholdBytes 1048576 Minimum bytes freed before logging (1MB)

Programmatic Configuration

GCConfig config = plugin.getConfig();
config.setAutoGcIntervalSeconds(30);  // Run every 30 seconds
config.setMinMemoryThresholdBytes(2097152);  // Log when >2MB freed

📁 Project Structure

HytaleSystemGC/
├── src/
│   └── main/
│       ├── java/
│       │   └── com/zuedev/systemgc/
│       │       ├── AutoGC.java          # GC scheduling logic
│       │       ├── GCConfig.java        # Configuration management
│       │       ├── SystemGCPlugin.java  # Main plugin entry point
│       │       └── package-info.java    # Package documentation
│       └── resources/
│           └── hytale.json              # Plugin manifest
├── pom.xml                              # Maven build configuration
├── LICENSE                              # Unlicense (Public Domain)
├── CONTRIBUTING.md                      # Contribution guidelines
└── README.md                            # This file

🤝 Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting a pull request.

📄 License

This project is released into the public domain under the Unlicense - see the LICENSE file for details.

About

Lightweight Hytale server plugin for automatic garbage collection at configurable intervals

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages