ZIP Problems - Szum123321/textile_backup GitHub Wiki

While using multiple backup mods for Minecraft I found out that most of them do not utilize all the available computational power and just use a single thread to do the compression. This is not optimal. Thanks to a wide range of java libraries such as Apache Commons Compress, At4J, BZip2, etc. I was able to create a mod that can take full advantage of the machine it's running on.

Sadly, due to how multi-threaded zip compression is implemented, it might crash the game in some cases.

To be more exact, ParallelScatterZipCreator uses temporary files, which on Linux systems are most often located in /tmp directory. Some Minecraft server providers may limit the size to the file system (which in most cases is desired). This causes java to fail to create the temporary file, thus rising an exception later.

To prevent the whole game from crashing, the mod checks if it's possible to create such a file, and if it's not, then a more classic implementation of the zip is going to be used, which means that the compression will take place on only one thread.

Edit: I'm still working on a fix. The method above doesn't actually work.

Luckily there are some actions you can take to counteract this issue such as:

  • Use different available compression scheme, such as GZIP which provides similar performance as zip and also utilizes multiple threads
  • Set compressionCoreCountLimit to one. This will force the mod to use a more standard zip compressor.
  • Change java's temporary directory using -Djava.io.tmpdir=[some available directory]. This will make the game store those files in a different place. WARNING temporary files might be created at high rates and in some cases may cause drop in performance and drive wear.

In case you still have some questions left please, do not hesitate to ask either on discord or through GitHub issue.