If your custom folder is too large, the JVM will run out of memory when creating the backup zip file.
Tested with 2 GB custom folder, but it might happen with much lower folder sizes.
Possible solutions:
Warn the user about custom folder size
Allow skipping the backup creation entirely
Copying folder instead of zipping it (redundancy of original replace/restore method)
If your custom folder is too large, the JVM will run out of memory when creating the backup zip file. Tested with 2 GB custom folder, but it might happen with much lower folder sizes.
Possible solutions: