Yet Another Memory Optimization (YAMO)
No reviews yet
Don't load JAR files in memory and lazy-load DFU
Enhances game performance and optimizes resource usage.
Neoforge is a fork of the Minecraft Forge available for versions 1.20.1+ of Minecraft. Many Forge mods are compatible with Neoforge and vice versa.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
Yet Another Memory Optimization (YAMO)
YAMO is an attempt to further optimize memory usage. It has two main features that can cut memory in (large) modpacks. The methods employed are somewhat hacky, so no guarantees that this works everywhere.
To fully experience what YAMO can do to free up memory you should create a new world with your pack, fly around a bit in creative, wait for a minute and then close and restart the game (for an explanation, see below).
In-memory JAR files
Mods are distributed as JAR files. The JAR loading mechanism that is part of NeoForge (and Forge) loads some inner JAR resources by keeping the entire file in memory. Most mods don't use this inner JAR mechanism, but some do. This can add up to hundreds of MBs in a large modpack.
The solution in YAMO is to store the in-memory JAR on disk in the 'cache/mods' subdirectory. Changes in the original JARs should be detected and the cache dir should be updated correctly. Deleting the cache dir is also fine, since it will be rebuild on the next run.
A further improvement to the JAR loading is in the in-memory index of the underlying ZIP structure. The JARs may be loaded multiple times from different places (might depend on JDK). When this is detected the ZIP index is deduped (which can be a couple of MBs for larger mods, e.g. MineColonies).
Attempt to load the DFU (DataFixerUpper) only when required
The DFU is responsible for upgrading NBT from older game versions to the current version on-the-fly. This is required when you load an old world where chunks, including blocks and entities, require updating. It is a complex rule-based process which requires 100Mb+ of RAM to store the rules efficiently so that the updating itself is fast. It has been much improved in terms of loading speed as well, so the need to load it lazily is smaller. To save memory this mod still attempts to load it only when required.
Because most mods that contain structures have NBT data from older versions it turns out that the DFU is required very quickly when you have some of those mods in your pack. When YAMO detects an old NBT structure it loads the DFU dynamically and then attempts to write all updated NBT structure data to the 'cache/structures' subdirectory. This process can take up to a minute and happens mostly in the background. The result is that all structures in your modpack are now available in the most recent NBT version and the DFU would not be required on the next run.
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers