LetUrMemoryRest is a Bukkit/Spigot plugin designed to help optimize your Minecraft server's performance through configurable memory management, redstone activity control, and explosion handling. It aims to reduce server load and improve stability by managing resources more effectively.
LetUrMemoryRest offers several modules to manage server resources. Each is configurable via plugins/LetUrMemoryRest/config.yml.
System.gc()) to free up unused memory.System.runFinalization() and forces a save of all worlds to disk.memory.cleanup-interval: Frequency (in ticks) of regular memory cleanups.memory.skip-when-ram-usage-is-in-percentage: If RAM usage is below this percentage, cleanup is skipped.memory.ram-warning-threshold & memory.ram-critical-threshold: Percentage thresholds that trigger warnings or more aggressive actions.memory.aggressive-cleanup-threshold: (Note: This seems to be another threshold, ensure its distinct role is clear or consolidated if it overlaps with ram-critical-threshold's aggressive cleanup).-XX:+DisableExplicitGC. This flag prevents System.gc() calls, rendering this feature ineffective. The plugin includes a startup check and will warn if this flag (or ExplicitGCInvokesConcurrent) is detected.redstone.max-per-area: Maximum redstone components allowed per chunk. Set to -1 to disable.redstone.check-chunk-on-start: If true, counts existing redstone components in chunks as they load to enforce limits.redstone.slowdown.enabled: Set to true to enable the experimental slowdown.redstone.slowdown.ticks: The delay applied to redstone updates when slowdown is active.inhabitedTime (how long players have spent in it) is below a configurable value.chunk.unload-inactive: Set to true to enable automatic unloading.chunk.unload-delay-in-ticks: How often (in ticks) the plugin attempts to unload inactive chunks.memory.chunk-unload-frequency: The minimum inhabitedTime (in ticks) a chunk must have to be considered "active" enough to avoid unloading by this feature (if no players are present).explosions.clear-drops: If true, explosions will not drop any items (yield is set to 0).explosions.drop-chance: If clear-drops is false, this sets a percentage chance (0-100) for each affected block to drop its items.slowdown-ticks: 2) Optionally, the original explosion event is cancelled, an explosion sound is played, and the affected blocks are broken sequentially over a series of ticks. This helps spread the server load from large explosions. A slowdown-ticks value of 0 attempts to break blocks instantly within the optimized logic (respecting other settings like drop chance).CREEPER) or block types (e.g., TNT) in explosions.ignored-explosions to exclude them from these optimizations.explosions.enabled: Toggle the entire explosion optimization system.explosions.limit-blocks: Max blocks affected. -1 for no limit (still subject to other optimizations).explosions.clear-drops, explosions.drop-chance, explosions.slowdown-ticks, explosions.ignored-explosions.ExplosionResult.KEEP or ExplosionResult.TRIGGER_BLOCK relies on API methods (getExplosionResult()) available in Spigot/Paper 1.20.5 and newer. On older server versions, this specific check might not function and could potentially cause errors if not handled gracefully by the server/API. (Developer note: Please verify this and ensure your plugin handles this API difference across the supported versions 1.13-1.21.x, or adjust the compatibility claims/note accordingly. If it can cause a NoSuchMethodError on 1.13-1.20.4, this is a critical accuracy point).memory.ram-critical-threshold, the plugin will stop and restart its background tasks (memory cleanup, chunk unloading).config.yml to the tasks. If you've modified config.yml (e.g., changed cleanup intervals) and reloaded it with /lumr reload, this mechanism ensures tasks use these (potentially less demanding) settings if the server becomes critically low on memory.dynamic-adjustment.enabled: Set to true to enable this behavior.dynamic-adjustment.min-cleanup-interval and min-chunk-unload-interval are present in config.yml but appear unused in the v4.3 code. Consider removing them or implementing their functionality to avoid confusion.)plugins/LetUrMemoryRest/config.yml file.config.yml file, preserving your current settings./lumr reload applies configuration changes without a server restart. /lumr reset reverts the configuration to the plugin's defaults (deletes config.yml and creates a new one)./lumr status: Shows current server RAM usage (Java heap percentage) and the total number of loaded chunks across all worlds./lumr show: Displays the currently active values for most configuration settings./lumr update.leturmemoryrest.admin permission) in-game if an update is found, providing the new version number and a download link. Console is also notified.updates.enabled, updates.ignore-alpha, updates.ignore-beta in config.yml control this feature.(Your command list is good, ensure usage matches any changes)
/leturmemoryrest reload (Alias: /lumr reload): Reload the plugin configuration./leturmemoryrest reset (Alias: /lumr reset): Reset the plugin configuration to default./leturmemoryrest status (Alias: /lumr status): Check current server RAM and chunk status./leturmemoryrest free (Alias: /lumr free): Manually trigger an aggressive memory cleanup./leturmemoryrest update (Alias: /lumr update): Check for plugin updates from Modrinth./leturmemoryrest show (Alias: /lumr show): Display current effective configuration values.(Your permission list is good)
leturmemoryrest.admin: Access to all plugin commands and receives update notifications.leturmemoryrest.reload: Allows reloading the configuration.leturmemoryrest.reset: Allows resetting the configuration.leturmemoryrest.free: Allows manually triggering aggressive cleanup.leturmemoryrest.status: Allows checking server status.leturmemoryrest.update: Allows checking for updates.leturmemoryrest.show: Allows displaying configuration values..jar file in your server's plugins folder.plugins/LetUrMemoryRest/config.yml as needed. Pay special attention to the JVM Note under Memory Management.Having issues or need help? Join our Discord server: Join our Discord
Crucial Steps for You (Developer):
Explosion Compatibility (getExplosionResult):
ExplosionManager on a Spigot/Paper server version older than 1.20.5 (e.g., 1.19.4, 1.16.5, 1.13.2) to see if event.getExplosionResult() causes a NoSuchMethodError.getExplosionResult().try { event.getExplosionResult(); ... } catch (NoSuchMethodError e) { /* fallback for older versions */ }.api-version in plugin.yml and stated compatibilities if you don't want to support older versions for this specific feature part.Unused Config Options:
dynamic-adjustment.min-cleanup-interval and min-chunk-unload-interval.
config.yml (default) and ConfigManager.java to avoid user confusion. This is the cleanest if they serve no purpose.Config Value Clarification:
memory.aggressive-cleanup-threshold, ensure its role is distinct from memory.ram-critical-threshold if both trigger aggressive cleanups. The code seems to use ramCriticalThreshold for aggressive cleanup decisions in performMemoryCleanup and aggressive-cleanup-threshold is not directly used there, but getAggressiveCleanupThreshold() exists. Check its usage. If aggressive-cleanup-threshold is for something else or redundant, clarify/remove.