Page 1 of 1

Out of Memory Error.

Posted: Thu May 29, 2025 11:39 am
by wiegleyj
God, I want to find an alternative to UMS.

Code: Select all

ERROR 23:34:10.976 [GuiManager Memory Usage Updater] Database error on getting memory cache size
org.h2.jdbc.JdbcSQLNonTransientConnectionException: The database has been closed [90098-232]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:690)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
        at org.h2.message.DbException.get(DbException.java:212)
        at org.h2.engine.SessionLocal.getTransaction(SessionLocal.java:1616)
        at org.h2.engine.SessionLocal.startStatementWithinTransaction(SessionLocal.java:1637)
        at org.h2.command.Command.executeQuery(Command.java:190)
        at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:130)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
        at net.pms.database.DatabaseEmbedded.getCacheSize(DatabaseEmbedded.java:319)
        at net.pms.database.MediaDatabase.getCacheSize(MediaDatabase.java:282)
        at net.pms.gui.GuiManager.updateMemoryUsage(GuiManager.java:321)
        at net.pms.gui.GuiManager.lambda$static$1(GuiManager.java:351)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.h2.mvstore.MVStoreException: java.lang.OutOfMemoryError: Java heap space [2.3.232/3]
        at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:996)
        at org.h2.mvstore.MVStore.tryExecuteUnderStoreLock(MVStore.java:941)
        at org.h2.mvstore.RandomAccessStore.doHousekeeping(RandomAccessStore.java:729)
        at org.h2.mvstore.FileStore.writeInBackground(FileStore.java:1841)
        at org.h2.mvstore.FileStore$BackgroundWriterThread.run(FileStore.java:2256)
Caused by: java.lang.OutOfMemoryError: Java heap space
Oh... "Increase Heap size" you say...

Already did that:

Code: Select all

nas@ums:~$ ps -elf | grep java
0 S nas       196742  196741  0  80   0 - 4759322 futex_ 22:32 pts/2  02:27:41 jre17/bin/java [b]-Xmx8G[/b] -Xss2048k -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djna.nosys=true -classpath update.jar:ums.jar net.pms.PMS
0 S nas       214885  214867  0  80   0 -  1769 pipe_r 23:36 pts/3    00:00:00 grep --color=auto java
WHAT COULD UMS POSSIBLY BE DOING TO CONSUME 8 GIGABYTES of space????

I can't stream a single movie to completion before UMS craps out. It's been this way for several versions now and, as you can see from my post history, just another entry in a long line of this program just throws out exceptions.

Re: Out of Memory Error.

Posted: Thu May 29, 2025 2:41 pm
by boss
Is this when playing with a LG TV?>
In the Linux version of UMS, the Java version used is the one supplied with UMS.
So changing the Java memory allocation in your system Java will have no effect.

You can either change the allocation in the supplied UMS Java or configure UMS to use your system Java.
This is done by editing the UMS.sh file in the UMS program folder like this.
To change the memory allocation in the UMS supplied version of Java, edit this:

Code: Select all

# Provide a means of setting max memory using an environment variable
if [ -z "$UMS_MAX_MEMORY" ]; then
    UMS_MAX_MEMORY=1280M
fi

# Execute the JVM
exec "$JAVA" $JAVA_OPTS -Xmx$UMS_MAX_MEMORY -Xss2048k -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djna.nosys=true -classpath "$PMS_JARS" net.pms.PMS "$@"
To make UMS use your system Java:
Change this:

Code: Select all

# Use our JVM if it exists
if [ -f jre17/bin/java ]; then
    JAVA="jre17/bin/java"
fi
To this:

Code: Select all

# Use our JVM if it exists
#if [ -f jre17/bin/java ]; then
#    JAVA="jre17/bin/java"
#fi

Re: Out of Memory Error.

Posted: Thu May 29, 2025 3:36 pm
by mik_s
@wiegleyj could you post your logs so I can see what could be causing this. One error message on its own is not enough. See the section in red above.

The previous problems you have asked about before you also did not supply logs so was unable to help and it was a long time till someone had the same issue for it to be fixed, like the illegal characters in filenames and OS language which were a unique Linux issues.