Jasione

Jasione

Reduce GC pressure by safely eliminating Enum#values array cloning and memory allocation overhead through bytecode analysis

by
30.6K Downloads
fabricforgeneoforgequiltoptimization
Rent Server with this Mod

About this Mod

Jasione

Overview

Jasione is an optimization mod that reduces memory allocation (GC pressure).

The Java compiler generates, for each enum class, a values() method that can be used to retrieve all enum values as an array. This method clones the array before returning it, ensuring that callers of this method can safely mutate the array without affecting other callers. This, however, incurs a performance cost. When invoked in hot paths, these small memory allocations accumulate and increase GC pressure.

Jasione addresses this issue by redirecting the values() calls that do not mutate the returned array to use a cache, eliminating the cloning overhead and the memory allocation. For details on how this is implemented safely, see to the "Technical Details" section below.

Configuration

Jasione currently offers several debug options, which can be used to inspect the optimization result. The configuration resides in config/jasione.toml.

#Specifies whether to enable the mod
enabled = true

[debug]
	#When enabled, logs statistics when optimizations are applied
	printOptimization = false
	#When enabled, dumps transformed classes to the ".jasione.out" folder
	dumpClasses = false

FAQs

Doesn't the JIT optimize the Enum#values() calls when they're safe?

No, the JIT compiler doesn't currently recognize even the most trivial use patterns like iterating through the values array. The cloning and memory allocation overhead persists, per JMH tests.

NeoForge displays a warning about this mod. Why?

When running this mod on the latest NeoForge (1.21.11+), you may encounter this warning:

[Render thread/ERROR] [ne.ne.fm.cl.tr.ClassTransformStatistics/]: Class processor jasione:main transformed 100.00% of loaded class which is suspiciously high; it may be attempting mass-ASM. Please report this to the mod author.

According to members of the NeoForge team, this message essentially acts as a nudge for mod authors to identify whether the use case is necessary. For Jasione, this transformation is necessary. (See the previous question)

For reference, see discussion on "The NeoForged Project" discord server (note that the discussion involved different implementations which didn't become the final version due to various issues. See the "Technical Details" section for more detail.)

Technical Details

The contract of Enum#values (where Enum refers to any enum class) is that the returned array is fresh and can be freely mutated. Therefore, we must identify which callers are safe to optimize by analyzing whether they mutate the array or the array escapes. This is made possible by utilizing the asm-analysis library. If array mutation or escapes are detected via bytecode analysis, the call remains unchanged to preserve correctness.

We need to find a place to store the cached values array, because the synthetic $VALUES field for enum classes is private. The current implementation performs runtime class generation. For each enum class, a corresponding cache holder class is generated to store the values array as a static final field. For example, when the transformer first detects use of net.minecraft.core.Direction#values, it generates the class me.decce.jasione.cached.net.minecraft.core.Direction, which holds a cached values array and various other metadata to ensure correctness. With this, it can transform all callers of the original values() method to use the cached class.

Available Versions

Jasione 1.0.7+26.1.2-neoforgerelease
MC 26.1, 26.1.1, 26.1.2, 26.2neoforge
August 21, 2026
Jasione 1.0.7+26.1.2-fabricrelease
MC 26.1, 26.1.1, 26.1.2, 26.2fabric, quilt
August 21, 2026
Jasione 1.0.7+1.21.11-neoforgerelease
MC 1.21.10, 1.21.11neoforge
August 21, 2026
Jasione 1.0.7+1.21.11-fabricrelease
MC 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11fabric, quilt
August 21, 2026
Jasione 1.0.7+1.21.1-neoforgerelease
MC 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8neoforge
August 21, 2026

How to Install Jasione on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (26.2).

3

Install Mod

Open the mod browser in the dashboard and search for "Jasione". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabricforgeneoforgequilt

Minecraft Versions

26.2, 26.1.2, 26.1.1 (+26 more)

Server-side

~ Optional

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Jasione server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (26.2). You can switch loaders with one click in the panel.

Is Jasione compatible with fabric and forge and neoforge and quilt?

Jasione officially supports fabric, forge, neoforge, quilt for Minecraft 26.2, 26.1.2, 26.1.1. Note: Forge and Fabric mods are NOT cross-compatible – pick one loader and stick with it. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Jasione – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Jasione consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Jasione with just one click on your server.

Recommended RAM
4 GBfrom €5.2/mo
Minimum 3 GB | per 8 players
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
GNU Lesser General Public License v3.0 only
Server-side
Optional

Supported Versions

26.226.1.226.1.126.11.21.111.21.101.21.91.21.81.21.71.21.6+19 more