FoamFix for Minecraft

Quick PSA: At this time, any FoamFix versions for 1.14+ are for Fabric only.

FoamFix is a mod designed to optimize post-1.7.10 modded Minecraft using simple, targeted optimizations. Observations show that Java heap usage (measured using VisualVM on the main menu) can drop by as much as 50%!

Features

FAQ

Q: I'm having performance issues, and removing FoamFix fixes them!

A:Make sure you have updated to the latest version. It is impossible for me to test FoamFix on the thousands of computer hardware configurations out there with my own resources, and sometimes issues specific to some of them can occur. If you have updated to the latest version and are still experiencing issues, contact me!

Q: Where did the Lawful Edition go?

A: The recommended way now is to set "enableCoremod" to false in an Anarchy version. It will still show a coremod is present, but the coremod will not actually modify any game logic. If you really need Lawful specifically, the builds still exist here.

Q: Can I run FoamFix on the server/client side if it's not present on the client/server side?

A: Almost all of FoamFix focuses on optimizing memory usage patterns common in Forge and mods. Porting it to vanilla would have very few benefits, as vanilla by itself is more efficient than even Forge+FoamFix.

Q: Can you run FoamFix in a development environment?

A: Yes, but you must manually deobfuscate it with BON2 or a similar tool.

Bug Reporting

Please try to reproduce the bug without FoamFix first - if it is still present without FoamFix, it is most likely not a FoamFix issue.

When you report a bug that only appears with FoamFix installed,

Please ONLY report them here! This helps me keep track of existing issues.

In particular, please do not report them to the other mod developers! If I get to the conclusion that the issue is caused by a different mod, I'll do my best to contact the other author myself and discuss the fix with them; however, unnecessary bug reports are a bit of a nuisance.

Additional Tips

(Note that this section will be rewritten as a more comprehensive optimization guide at some point)

Enable alwaysSetupTerrainOffThread in forge.cfg. (Since 0.6.3, FoamFix will automatically do this for you on new instances!)

Install BetterFPS - it optimizes other areas of Minecraft not targetted by FoamFix.

If you're experiencing "ghost chunk loading"-related lag (a noticeable lag spike every ~30 seconds), a way to partially work around the problem is to increase the value of dormantChunkCacheSize in forgeChunkLoading.cfg.

For some GPU/driver configurations, disabling mipmaps (setting Mipmap Levels to 0) will boost FPS considerably. This is due to lag caused by animated texture updates being much higher with increasing amounts of textures to update, which scales linearly with the amount of mipmap levels. Since 0.6.3, FoamFix sets the setting as default on new instances.

On dedicated servers, setting max-tick-time=0 can solve crashes related to "java.lang.Error: Watching server". Still looking into why this happens!

Common Crashes

java.lang.IllegalArgumentException: Cannot set property [...], it is not an allowed value - The codepath causing this error mimics vanilla behaviour very closely, and should cause the same crash without FoamFix. Make sure it cannot be reproduced without FoamFix.

If you're using SpongeForge alongside FoamFix (keep in mind that I do not support it), a common crash related to MixinMutableBlockPos can be fixed by disabling coremod.optimizedBlockPos in config/foamfix.cfg.

Support

Please only use the GitHub issue tracker for bug reports. Makes it easier to keep track of them.

Please note that "not supported" does not mean "won't work at all" - rather, it means "things can break and I might be unable to help you for various reasons". Be careful!

The following mods are supported to a reasonable extent and I will do my best to fix bugs related to interactions with them:

BetterFPS. I recommend using BetterFPS in particular if your CPU is low on L2/L3 cache.

FastWorkbench/FastFurnace. Must-have. Highly recommended.

Phosphor. Seems pretty cool.

VanillaFix. It is rather invasive (which scares me a little), but also effective. If you need it, you can probably use it.

most other FOSS optimization mods

The following mods are not supported and I cannot guarantee satisfactory fixes related to interactions with them:

FastCraft 2. The licensing is very strict and debugging impossible without relying on the developer as an oracle.

NotEnoughIDs. Not maintained since September 2017.

OptiFine. The licensing is very strict and debugging impossible without relying on the developer as an oracle.

Sponge. Some of our engine changes conflict. (Note that, even if you have Sponge on the server side, using FoamFix on the client side while connecting to a Sponge server is supported!)

TexFix.

most other proprietary optimization mods

If you'd like to support future mod development from me, please consider donating via the link above or through Patreon.

Im running the 1.14 version, I have fabric, fabric API and the Mod menu for fabric. I put the foam fix file into the Mod folder, run Minecraft, look in the Mod Menu and its showing up. It also doesn't seem to be improving my Minecraft performance.

Am I supposed to put the file somewhere else or is there some other silly mistake I am making?

Are there any rough guidelines for when Optifine or FoamFix are better? As in mod quantity, mod's weight on the game, etc? Since thewy're both compatible with VanillaFix AND BetterFps I will be playing either optifine or FoamFix with those two alltogether.

Got a decent pc, in case that matters, and I don't REALLY need the mods, only to make sure, make everything more stable and a little fps boost never hurts c:

Hey, I was wondering what would be better, Optifine, or FoamFix? Does it depend on the number of mods? I am currently trying to find as many mods as I can (that I like) and so far I've gotten 120+ mods. Obviously, with so many mods, I am bound to overwork my poor laptop. I've stuck with Optifine for quite a while, ever since someone first told me about it when I found Minecraft Java had a worse FPS than the Xbox. However, I am willing to give it up if it means getting rid of my performance issues.

While typing this, I found VanillaFix, which sounds incredibly promising, would this eliminate the need for Optifine when it comes to modded Minecraft?

I think that's all I have for now. If you have any questions for me, let me know.

Just try thing out man. All I can say is that I know that VanillaFix should be able to run alongside optifine. Aswell as another mod called BetterFps. Havent tried any of them besides optifine, just giving you options, try it and combinations with them out.

*Edit: I've just read that this one here is also able to work with VanillaFix and BetterFps, so I would assume, with a bit of trying, it MIGHT be possible to have all four performance-enhancing mods in.