Skip to content

/tmp out of memory when loading large(?) mods #196

Description

@ilonachan

I was trying to install the Girly Animation Pack mod, which has a lot of option variants. During the initial load process UKMM kept aborting claiming there's "no space on device", which initially confused me because neither the usage of my main drive nor the big hard drive I put my games and mods on was going up at all! Turns out my Linux /tmp partition was limited to 8GB, and remounting it slightly larger did allow the import to complete (though it did break large parts of my system and forced me to restart).

This is a huge problem for Linux users specifically (where I've been told /tmp is normally allocated to be half of the user's physical RAM), but potentially for anyone whose OS temp directory is on a drive with little space left. I understand that it's not really UKMM's responsibility to allocate its own temp directories, but we might want to consider it in this case: BotW is a big game, mods can get pretty big, and if they require multiple GBs of drive space to even be loaded in this cannot be reliably done in the OS temp folder. On Linux, forcing the user to remount a tmpfs (or even causing issues while doing it automatically) is an extremely bad idea for usability, and on Windows I can't even think of a solution (perhaps symlinking the temp folder might work).

One proposal to fix this in general would be to have a UKMM-specific tmp folder under its storage directory, or give the user a settings option pointing to a really large fallback drive. This doesn't even need to be the default (since having the system handle temp files where possible is probably good), but if we receive an OSError because there's not enough space then UKMM could now fall back to this path where there IS space. Even if this problem only ever comes up on Linux with low RAM specs for big mods, having a fallback like this would be broadly useful.

Another potential solution could be, for mods with many different options, to let the user select their desired options upfront and only even load those. Though this would be incompatible with the ability to select different options later, it might be useful as an emergency option for low-end devices.

It's also possible that this is indicative of a deeper issue with how (BNP) mods are processed; because both the input BNP and the output ZIP file end up being just 60MB, it must be the diffing(?) step of the conversion that balloons the temp directory, and it doesn't seem like this is cleaned up when moving on to the next option. Maybe there's a way this step could be made more efficient, eliminating the need for fallbacks and workarounds altogether?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions