question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Out of Memory exception

See original GitHub issue

Hi, first, thank you for your time and this great app.

Second, I have this problem:

2017-03-14 07:20:42 ERROR OffsetGetterWeb$:103 - Failed to run scheduled task
java.sql.SQLException: [SQLITE_CANTOPEN]  Unable to open the database file (out of memory)
        at org.sqlite.DB.newSQLException(DB.java:383)
        at org.sqlite.DB.newSQLException(DB.java:387)
        at org.sqlite.DB.throwex(DB.java:374)
        at org.sqlite.NativeDB._open(Native Method)
        at org.sqlite.DB.open(DB.java:86)
        at org.sqlite.Conn.open(Conn.java:140)
        at org.sqlite.Conn.<init>(Conn.java:57)
        at org.sqlite.JDBC.createConnection(JDBC.java:77)
        at org.sqlite.JDBC.connect(JDBC.java:64)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:208)
        at scala.slick.jdbc.JdbcBackend$DatabaseFactoryDef$$anon$4.createConnection(JdbcBackend.scala:70)
        at scala.slick.jdbc.JdbcBackend$BaseSession.conn$lzycompute(JdbcBackend.scala:397)
        at scala.slick.jdbc.JdbcBackend$BaseSession.conn(JdbcBackend.scala:397)
        at scala.slick.jdbc.JdbcBackend$BaseSession.withTransaction(JdbcBackend.scala:420)
        at scala.slick.backend.DatabaseComponent$DatabaseDef$$anonfun$withTransaction$1.apply(DatabaseComponent.scala:54)
        at scala.slick.backend.DatabaseComponent$DatabaseDef$$anonfun$withTransaction$1.apply(DatabaseComponent.scala:54)
        at scala.slick.backend.DatabaseComponent$DatabaseDef$class.withSession(DatabaseComponent.scala:34)
        at scala.slick.jdbc.JdbcBackend$DatabaseFactoryDef$$anon$4.withSession(JdbcBackend.scala:61)
        at scala.slick.backend.DatabaseComponent$DatabaseDef$class.withTransaction(DatabaseComponent.scala:54)
        at scala.slick.jdbc.JdbcBackend$DatabaseFactoryDef$$anon$4.withTransaction(JdbcBackend.scala:61)
        at com.quantifind.kafka.offsetapp.OffsetDB.insertAll(OffsetDB.scala:66)
        at com.quantifind.kafka.offsetapp.sqlite.SQLiteOffsetInfoReporter.report(SqliteOffsetInfoReporter.scala:9)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$$anonfun$reportOffsets$1$$anonfun$apply$6$$anonfun$apply$1.apply(OffsetGetterWeb.scala:73)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$$anonfun$reportOffsets$1$$anonfun$apply$6$$anonfun$apply$1.apply(OffsetGetterWeb.scala:73)
        at scala.util.Try$.apply(Try.scala:192)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$.retryTask(OffsetGetterWeb.scala:58)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$$anonfun$reportOffsets$1$$anonfun$apply$6.apply(OffsetGetterWeb.scala:73)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$$anonfun$reportOffsets$1$$anonfun$apply$6.apply(OffsetGetterWeb.scala:73)
        at scala.collection.mutable.HashSet.foreach(HashSet.scala:78)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$$anonfun$reportOffsets$1.apply(OffsetGetterWeb.scala:73)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$$anonfun$reportOffsets$1.apply(OffsetGetterWeb.scala:70)
        at scala.collection.Iterator$class.foreach(Iterator.scala:893)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
        at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$.reportOffsets(OffsetGetterWeb.scala:69)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$$anonfun$schedule$1.apply$mcV$sp(OffsetGetterWeb.scala:79)
        at com.quantifind.kafka.offsetapp.OffsetGetterWeb$$anon$2.run(OffsetGetterWeb.scala:48)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

I using retain 2 days and Zookeeper as storage. My version is 0.4.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
rcasey212commented, Apr 24, 2017

Hi @Rohlik I recommend you run this as a user other than root, as you may also run into issues with the DB trying to run its native code from the /tmp directory as root, which most linux distributions do not allow be default.

0reactions
Rohlikcommented, Mar 17, 2017

As you can see I have some memory available, also swap is almost empty.

#free -m
              total        used        free      shared  buff/cache   available                                                                                                                                    
Mem:            992         640          65         103         287          81                                                                                                                                    
Swap:          1022          16        1006

How much memory I need for running offset monitoring tool without problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

3.2 Understand the OutOfMemoryError Exception
One common indication of a memory leak is the java.lang.OutOfMemoryError exception. Usually, this error is thrown when there is insufficient space to ...
Read more >
Understanding OutOfMemoryError Exception in Java
Usually, this error is thrown when the Java Virtual Machine cannot allocate an object because it is out of memory. No more memory...
Read more >
How to Handle the OutOfMemoryError in Java - Rollbar
A java.lang.OutOfMemoryError is a runtime error in Java which occurs when the Java Virtual Machine (JVM) is unable to allocate an object due ......
Read more >
Java OutOfMemoryError Exceptions: Causes & Fixes [Tutorial]
Java Heap space is one of the most common errors when it comes to memory handling in the Java Virtual Machine world. This...
Read more >
C# : Out of Memory exception - Stack Overflow
Any memory allocation in .NET that is over 85,000 bytes comes from the large object heap (LOH) not the normal small object heap....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found