zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Ask questions about your setup or get help installing ZCS server (ZD section below).
Leeloo
Posts: 10
Joined: Thu Apr 24, 2025 2:16 pm

zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by Leeloo »

Hello,

I use zmmailbox to create dump/backup of my mailboxes.
But after upgrade to "Release 10.1.8.GA.4633.RHEL8_64.20240610085557 NETWORK edition.", I got this error message on some mailboxes (the bigger ones).

Code: Select all

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:3519)
	at com.zimbra.client.ZMailbox.getRESTResource(ZMailbox.java:3642)
	at com.zimbra.client.ZMailbox.getRESTResource(ZMailbox.java:3604)
	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)
Here is the original value of zimbra_zmjava_options

Code: Select all

zimbra_zmjava_options = -Xmx256m -Dhttps.protocols=TLSv1.2,TLSv1.3 -Djdk.tls.client.protocols=TLSv1.2,TLSv1.3 -Djava.net.preferIPv4Stack=true
if I set to 1024m, some mailboxes are able to be backuped, but others no.
The dump/backup have been always working before.

The size of mailboxes did not increase (just a little) between versions 10.1.7 and 10.1.8.

Does anyone else experience this behaviour?


Thank you.
Leeloo
Posts: 10
Joined: Thu Apr 24, 2025 2:16 pm

Re: zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by Leeloo »

even if I set to 8Go (my machine got 32Go), I've got another error :

Code: Select all

Exception in thread "main" java.lang.OutOfMemoryError: Required array length 2147483639 + 580 is too large
	at java.base/jdk.internal.util.ArraysSupport.hugeLength(ArraysSupport.java:649)
	at java.base/jdk.internal.util.ArraysSupport.newLength(ArraysSupport.java:642)
	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:3519)
	at com.zimbra.client.ZMailbox.getRESTResource(ZMailbox.java:3642)
	at com.zimbra.client.ZMailbox.getRESTResource(ZMailbox.java:3604)
	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)
Klug
Ambassador
Ambassador
Posts: 2883
Joined: Mon Dec 16, 2013 11:35 am
Location: France - Drôme
ZCS/ZD Version: All of them
Contact:

Re: zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by Klug »

Open a case, as it's a Network Edition.
Leeloo
Posts: 10
Joined: Thu Apr 24, 2025 2:16 pm

Re: zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by Leeloo »

Thanks for you answer.

What is the procedure to follow?
Klug
Ambassador
Ambassador
Posts: 2883
Joined: Mon Dec 16, 2013 11:35 am
Location: France - Drôme
ZCS/ZD Version: All of them
Contact:

Re: zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by Klug »

cnassis
Posts: 3
Joined: Thu Apr 11, 2019 5:36 am

Re: zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by cnassis »

The same problem after upgrading to Release 10.1.8.GA.4655.UBUNTU22_64 NETWORK edition.
Klug
Ambassador
Ambassador
Posts: 2883
Joined: Mon Dec 16, 2013 11:35 am
Location: France - Drôme
ZCS/ZD Version: All of them
Contact:

Re: zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by Klug »

BTW, why do you use zmmailbox to backup your mailboxes while you have the backup feature in the product?
Leeloo
Posts: 10
Joined: Thu Apr 24, 2025 2:16 pm

Re: zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by Leeloo »

Thanks for your answer.

With the embeded backup feature, is there a way to search or list the content of a backup session, in order to find a deleted mail, that will be present in a backup ?

Thanks
Klug
Ambassador
Ambassador
Posts: 2883
Joined: Mon Dec 16, 2013 11:35 am
Location: France - Drôme
ZCS/ZD Version: All of them
Contact:

Re: zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by Klug »

The current backup system for Daffodil is not a continuous (real-time) backup (like the NG backup was).
You cannot restore items in a mailbox based on their delete date/time (restore all items deleted between two date/time).
You can however do a "restoreToTime" of a mailbox.
https://zimbra.github.io/documentation/ ... oring_data

I think I read somewhere the "realtime backup" feature is under development.

However there's the dumpster feature.
if you're looking for a deleted mail, this is the first place you should look into (30 days retention default, can be increased).
teyxwhat
Posts: 2
Joined: Mon Jun 10, 2019 2:40 pm

Re: zmmailbox : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Post by teyxwhat »

I was getting the same error. Eventually support suggested:

curl -k -u 'admin@example.com:password' https://mail.example.com:7071/home/user ... m/?fmt=tgz > /tmp/user@example.com.tgz


substitute admin with any user with admin privileges
remove password from command so that it prompts instead
Post Reply