Handle out of memory exception
TheFonsi opened this issue · 6 comments
Description
Add option to handle OutOfMemory exception for repair after will be avaible memory. I mean to stop spam in console with this error:
[21:59:38] [pool-17-thread-3/WARN]: Exception in thread "pool-17-thread-3" java.lang.OutOfMemoryError: Java heap space
[21:59:38] [Paper Watchdog Thread/WARN]: Exception in thread "Paper Watchdog Thread" java.lang.OutOfMemoryError: Java heap space
[21:59:38] [pool-17-thread-1/WARN]: Exception in thread "pool-17-thread-1" java.lang.OutOfMemoryError: Java heap space
[21:59:38] [luckperms-scheduler-worker-94/WARN]: java.sql.SQLException: ResultSet is from UPDATE. No Data.
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.result.ResultSetImpl.next(ResultSetImpl.java:1749)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at me.lucko.luckperms.lib.hikari.pool.HikariProxyResultSet.next(HikariProxyResultSet.java)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at me.lucko.luckperms.common.messaging.sql.AbstractSqlMessenger.pollMessages(AbstractSqlMessenger.java:119)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at me.lucko.luckperms.common.plugin.scheduler.AbstractJavaScheduler$ErrorReportingRunnable.run(AbstractJavaScheduler.java:124)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[21:59:38] [luckperms-scheduler-worker-94/WARN]: at java.base/java.lang.Thread.run(Thread.java:831)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: java.sql.SQLException: ResultSet is from UPDATE. No Data.
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.result.ResultSetImpl.next(ResultSetImpl.java:1749)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at me.lucko.luckperms.lib.hikari.pool.HikariProxyResultSet.next(HikariProxyResultSet.java)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at me.lucko.luckperms.common.messaging.sql.AbstractSqlMessenger.pollMessages(AbstractSqlMessenger.java:119)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at me.lucko.luckperms.common.plugin.scheduler.AbstractJavaScheduler$ErrorReportingRunnable.run(AbstractJavaScheduler.java:124)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[21:59:38] [luckperms-scheduler-worker-132/WARN]: at java.base/java.lang.Thread.run(Thread.java:831)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: java.sql.SQLException: ResultSet is from UPDATE. No Data.
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.result.ResultSetImpl.next(ResultSetImpl.java:1749)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at me.lucko.luckperms.lib.hikari.pool.HikariProxyResultSet.next(HikariProxyResultSet.java)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at me.lucko.luckperms.common.messaging.sql.AbstractSqlMessenger.pollMessages(AbstractSqlMessenger.java:119)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at me.lucko.luckperms.common.plugin.scheduler.AbstractJavaScheduler$ErrorReportingRunnable.run(AbstractJavaScheduler.java:124)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[21:59:38] [luckperms-scheduler-worker-131/WARN]: at java.base/java.lang.Thread.run(Thread.java:831)
you can’t repair out of memory… fill in the issue template with details stated as well as the amount of ram you used. Bcu you you are just giving your server unreasonable little ram, then there is no point reporting this.
This is not really up for debate. An OutOfMemoryError
is an error and it is not normal behavior:
Error
: indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions.
VirtualMachineError
: indicates that the Java Virtual Machine is broken or has run out of resources necessary for it to continue operating.
OutOfMemoryError
: cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector.
As of now it can be a potential indicator of a memory leak too (see #3027 #3032).
And given that you did not specify any kind of system information or any context whatsoever it's not really possible to help with the problem in question either.
I specially gave small memory and I saw this. So I gave some my time to report it just for author no for make necessary discussion.
See the quote posted by @emilyy-dev above:
Error: indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions.
The solution is to allocate more memory to your server. There is nothing the application can reasonably do to "handle" this.