Hello,
After upgrading to Zimbra OSS 10.0.18, our individual mailbox backup scripts (using zmmailbox) stopped working and started generating the following Java heap space error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.Arrays.copyOf(Arrays.java:3537)
at java.base/java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:100)
at java.base/java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:130)
at com.zimbra.client.ZMailbox.getResource(ZMailbox.java:3502)
at com.zimbra.client.ZMailbox.getRESTResource(ZMailbox.java:3625)
at com.zimbra.client.ZMailbox.getRESTResource(ZMailbox.java:3587)
at com.zimbra.cs.zclient.ZMailboxUtil.doGetRestURL(ZMailboxUtil.java:3025)
at com.zimbra.cs.zclient.ZMailboxUtil.execute(ZMailboxUtil.java:1220)
at com.zimbra.cs.zclient.ZMailboxUtil.main(ZMailboxUtil.java:2917)
To resolve this, we have refactored our backup scripts to use Curl via the REST API instead of the native zmmailbox command. This bypasses the Java heap limits of the client utility.
If you are facing the same issue, you can use the following commands to get your backups working again:
1. Working EXPORT command:
curl -v -k -u
admin@DOMAIN.fr:PASSWORD '
https://webmail.DOMAIN.fr:7071/home/tes ... r/?fmt=tgz' -o /tmp/test_mailbox.tgz
2. Working IMPORT command:
curl -v -k -u
admin@DOMAIN.fr:PASSWORD --data-binary "@/mnt/backup/test_mailbox.tgz" "
https://webmail.DOMAIN.fr:7071/home/res ... solve=skip"
Using this method should prevent any "OutOfMemory" errors as it streams the data directly.
Enjoy!