Nah, I "only" have 32GB in that system (and only 2GB of swap, because I like to live on the edge).
Besides, I "only" tend to give Java an 8GB heap to work with, so that's a hard limit.
It isn't that the game is allocating 41GB all at once, it's that it keeps rapidly allocating and destroying objects. For a while I wondered why the game seemed to run very smoothly with my status deferral patch on certain systems (my gaming PC and my MacBook Pro when docked) and not-so-well on others (my ThinkPad, and my MacBook Pro when undocked).
Now that I see what's doing, I think the game is tearing through allocations so quickly that shared RAM is actually proving to be a bottleneck! My gaming PC uses a dedicated GPU, so obviously shared RAM isn't a concern on there. The MBP is wired up so that the dedicated GPU is forced on when you plug in an external monitor (via DisplayPort/Thunderbolt, not AirPlay), but it generally runs with integrated graphics like most laptops, and when it does the same lag happens there. The ThinkPad
only has integrated graphics.
So, yeah…if I continue working on performance mods I'm going to exclusively develop them on the ThinkPad, since that's going to give me the most honest view of the game's performance. If this is the case (and I'm fairly certain it is) that would explain why the CPU usage seemed to be reasonably low despite the game lagging to high heaven. My status deferral mod makes it less bad on these systems, but there's a lot more tomfoolery at foot.
I honestly never thought I'd need to think about low-level hardware design in relation to a Java game, but here we are.