OutOfMemoryError: Java heap space when running restore.sh

LogicalDOC has many interesting features, but requires some configuration process to show its full potential.

Moderator: car031

die7fox
Posts: 50
Joined: Thu Sep 18, 2014 10:20 am

OutOfMemoryError: Java heap space when running restore.sh

Wed Aug 29, 2018 9:42 pm

While attempting to restore LogicalDOC from backup, all goes well until near the end, when I get the following error while attempting to restore the database:

[exec] INFO - Recovering /mnt/backup2/database/20180828.zip (1 file) ...
[exec] INFO - 90%
[exec] 18-08-29 16:13 - ERROR
[exec] INFO - 100%
[exec] INFO - Recovery completed.
[exec] INFO - ------------------------------------------------------------------
[exec] INFO - An error occurred during the process : java.lang.OutOfMemoryError: Java heap space
[exec] INFO - Please refer to the log file : /LogicalDOC/backup_home2/conf/../logs/database.18-08-29.log
[exec] INFO - ------------------------------------------------------------------
[exec] java.lang.OutOfMemoryError: Java heap space
[exec] at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:239)
[exec] at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:271)
[exec] at com.logicaldoc.backup.file.delta.tools.IOHelper.skipFully(IOHelper.java:93)
[exec] at com.logicaldoc.backup.file.delta.DeltaInputStream.read(DeltaInputStream.java:115)
[exec] at com.logicaldoc.backup.file.delta.DeltaInputStream.read(DeltaInputStream.java:71)
[exec] at com.logicaldoc.backup.file.FileTool.copy(FileTool.java:228)
[exec] at com.logicaldoc.backup.application.impl.handler.DeltaArchiveHandler.recoverRawFile(DeltaArchiveHandler.java:488)
[exec] at com.logicaldoc.backup.application.impl.handler.DeltaArchiveHandler$1.run(DeltaArchiveHandler.java:408)
[exec] at com.logicaldoc.backup.application.impl.AbstractIncrementalFileSystemMedium.doAndRetry(AbstractIncrementalFileSystemMedium.java:1566)
[exec] at com.logicaldoc.backup.application.impl.handler.DeltaArchiveHandler.recoverRawData(DeltaArchiveHandler.java:406)
[exec] at com.logicaldoc.backup.application.impl.AbstractIncrementalFileSystemMedium.recoverImpl(AbstractIncrementalFileSystemMedium.java:1847)
[exec] at com.logicaldoc.backup.application.impl.AbstractIncrementalFileSystemMedium.recover(AbstractIncrementalFileSystemMedium.java:1925)
[exec] at com.logicaldoc.backup.application.impl.AbstractIncrementalFileSystemMedium.recover(AbstractIncrementalFileSystemMedium.java:1199)
[exec] at com.logicaldoc.backup.application.impl.FileSystemTarget.processRecoverImpl(FileSystemTarget.java:320)
[exec] at com.logicaldoc.backup.application.AbstractTarget.processRecover(AbstractTarget.java:903)
[exec] at com.logicaldoc.backup.application.ActionProxy.processRecoverOnTarget(ActionProxy.java:146)
[exec] 18-08-29 16:13 - ERROR
[exec] at com.logicaldoc.backup.application.launcher.tui.Launcher.processRecover(Launcher.java:599)
[exec] at com.logicaldoc.backup.application.launcher.tui.Launcher.launchImpl(Launcher.java:149)
[exec] at com.logicaldoc.backup.system.AbstractLauncher.launch(AbstractLauncher.java:47)
[exec] at com.logicaldoc.backup.application.launcher.tui.Launcher.main(Launcher.java:86)
[exec] com.logicaldoc.backup.application.ApplicationException: java.lang.OutOfMemoryError: Java heap space
[exec] at com.logicaldoc.backup.application.impl.AbstractIncrementalFileSystemMedium.recoverImpl(AbstractIncrementalFileSystemMedium.java:1867)
[exec] at com.logicaldoc.backup.application.impl.AbstractIncrementalFileSystemMedium.recover(AbstractIncrementalFileSystemMedium.java:1925)
[exec] at com.logicaldoc.backup.application.impl.AbstractIncrementalFileSystemMedium.recover(AbstractIncrementalFileSystemMedium.java:1199)
[exec] at com.logicaldoc.backup.application.impl.FileSystemTarget.processRecoverImpl(FileSystemTarget.java:320)
[exec] at com.logicaldoc.backup.application.AbstractTarget.processRecover(AbstractTarget.java:903)
[exec] at com.logicaldoc.backup.application.ActionProxy.processRecoverOnTarget(ActionProxy.java:146)
[exec] at com.logicaldoc.backup.application.launcher.tui.Launcher.processRecover(Launcher.java:599)
[exec] at com.logicaldoc.backup.application.launcher.tui.Launcher.launchImpl(Launcher.java:149)
[exec] at com.logicaldoc.backup.system.AbstractLauncher.launch(AbstractLauncher.java:47)
[exec] at com.logicaldoc.backup.application.launcher.tui.Launcher.main(Launcher.java:86)
[exec] Caused by: java.lang.OutOfMemoryError: Java heap space
[exec] at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:239)
[exec] at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:271)
[exec] at com.logicaldoc.backup.file.delta.tools.IOHelper.skipFully(IOHelper.java:93)
[exec] at com.logicaldoc.backup.file.delta.DeltaInputStream.read(DeltaInputStream.java:115)
[exec] at com.logicaldoc.backup.file.delta.DeltaInputStream.read(DeltaInputStream.java:71)
[exec] at com.logicaldoc.backup.file.FileTool.copy(FileTool.java:228)
[exec] at com.logicaldoc.backup.application.impl.handler.DeltaArchiveHandler.recoverRawFile(DeltaArchiveHandler.java:488)
[exec] at com.logicaldoc.backup.application.impl.handler.DeltaArchiveHandler$1.run(DeltaArchiveHandler.java:408)
[exec] at com.logicaldoc.backup.application.impl.AbstractIncrementalFileSystemMedium.doAndRetry(AbstractIncrementalFileSystemMedium.java:1566)
[exec] at com.logicaldoc.backup.application.impl.handler.DeltaArchiveHandler.recoverRawData(DeltaArchiveHandler.java:406)
[exec] at com.logicaldoc.backup.application.impl.AbstractIncrementalFileSystemMedium.recoverImpl(AbstractIncrementalFileSystemMedium.java:1847)
[exec] ... 9 more

BUILD FAILED
/LogicalDOC/backup_home2/build.xml:491: The following error occurred while executing this line:
/LogicalDOC/backup_home2/build.xml:335: The following error occurred while executing this line:
/LogicalDOC/backup_home2/build.xml:378: The following error occurred while executing this line:
/LogicalDOC/backup_home2/build.xml:41: exec returned: 1


Backup operations work fine, and so does the application. It's only on a restore job that I see this error. Where can I go to increase my heap size to prevent this failure?

I tried attaching the log the error message referenced, but I keep getting this error: Invalid file extension: database.18-08-29.log
shatzing
Posts: 79
Joined: Tue Jan 21, 2014 9:46 am

Re: OutOfMemoryError: Java heap space when running restore.sh

Thu Aug 30, 2018 8:41 am

Hi die7fox,
if you're on Windows change the file restore.bat as follows:

@echo off
set "PROGRAM_DIR=%~dp0"
set "ANT_HOME=%PROGRAM_DIR%ant"
set "ANT_OPTS=-Xmx2048M"
"%ANT_HOME%\bin\ant.bat" -f "%PROGRAM_DIR%\build.xml" restore

If you're on linux change restore.sh

PROGRAM_DIR=`dirname "$0"`
export ANT_HOME=$PROGRAM_DIR/ant
export ANT_OPTS=-Xmx2048M
$ANT_HOME/bin/ant -f $PROGRAM_DIR/build.xml restore
die7fox
Posts: 50
Joined: Thu Sep 18, 2014 10:20 am

Re: OutOfMemoryError: Java heap space when running restore.sh

Thu Aug 30, 2018 2:38 pm

Thank you for your reply, but I'm afraid this did not solve the problem. I added the line to restore.sh that you suggested, but I got the same out of memory error at the same point in the process. Should I increase the value from 2048 to something else?

I'm running LogicalDOC 8.0 on CentOS 7.

Return to “Configuration”

Who is online

Users browsing this forum: No registered users and 1 guest