Fatal Error at getFromFile: OutOfMemoryError

Help
Anonymous
2012-03-28
2014-01-19

  • Anonymous
    2012-03-28

    I'm having an issue with HSQLDB 2.2.6 which suddenly fails opening a database of about 20 MB size.

    First I get this exception:

    28.03.2012 15:22:35 FATAL /…/photos.data getFromFile out of mem 12525456
    java.lang.OutOfMemoryError: Java heap space
    at org.hsqldb.lib.StringConverter.readUTF(Unknown Source)
    at org.hsqldb.rowio.RowInputBinary.readString(Unknown Source)
    at org.hsqldb.rowio.RowInputBinary.readChar(Unknown Source)
    at org.hsqldb.rowio.RowInputBase.readData(Unknown Source)
    at org.hsqldb.rowio.RowInputBinary.readData(Unknown Source)
    at org.hsqldb.rowio.RowInputBase.readData(Unknown Source)
    at org.hsqldb.rowio.RowInputBinary.readData(Unknown Source)
    at org.hsqldb.rowio.RowInputBinaryDecode.readData(Unknown Source)
    at org.hsqldb.RowAVLDisk.<init>(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.get(Unknown Source)
    at org.hsqldb.persist.DataFileCache.getFromFile(Unknown Source)
    at org.hsqldb.persist.DataFileCache.get(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.get(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.setAccessor(Unknown Source)
    at org.hsqldb.Table.setIndexRoots(Unknown Source)
    at org.hsqldb.Table.setIndexRoots(Unknown Source)
    at org.hsqldb.StatementCommand.getResult(Unknown Source)
    at org.hsqldb.StatementCommand.execute(Unknown Source)
    at org.hsqldb.Session.executeCompiledStatement(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderText.readDDL(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderBase.readAll(Unknown Source)
    at org.hsqldb.persist.Log.processScript(Unknown Source)
    at org.hsqldb.persist.Log.open(Unknown Source)
    at org.hsqldb.persist.Logger.openPersistence(Unknown Source)
    at org.hsqldb.Database.reopen(Unknown Source)
    at org.hsqldb.Database.open(Unknown Source)
    at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
    at org.hsqldb.DatabaseManager.newSession(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)

    When I then set the max heap to 4GB I get this exception instead:

    28.03.2012 14:56:16 FATAL /…./photos.data getFromFile 12525456
    org.hsqldb.HsqlException: java.io.UTFDataFormatException
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.get(Unknown Source)
    at org.hsqldb.persist.DataFileCache.getFromFile(Unknown Source)
    at org.hsqldb.persist.DataFileCache.get(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.get(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.setAccessor(Unknown Source)
    at org.hsqldb.Table.setIndexRoots(Unknown Source)
    at org.hsqldb.Table.setIndexRoots(Unknown Source)
    at org.hsqldb.StatementCommand.getResult(Unknown Source)
    at org.hsqldb.StatementCommand.execute(Unknown Source)
    at org.hsqldb.Session.executeCompiledStatement(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderText.readDDL(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderBase.readAll(Unknown Source)
    at org.hsqldb.persist.Log.processScript(Unknown Source)
    at org.hsqldb.persist.Log.open(Unknown Source)
    at org.hsqldb.persist.Logger.openPersistence(Unknown Source)
    at org.hsqldb.Database.reopen(Unknown Source)
    at org.hsqldb.Database.open(Unknown Source)
    at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
    at org.hsqldb.DatabaseManager.newSession(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)

    Updating to HSQLDB 2.2.8 unfortunately did not help.

    Any help greatly appreciated.

     
  • Fred Toussi
    Fred Toussi
    2012-03-28

    You must update to 2.2.8. It won't fix the problem with this database, but will avoid it in the future.

     

  • Anonymous
    2012-03-30

    Thanks for your reply Fred. It wasn't clear for me from the changelist of 2.2.8/tracker if the fixed issues there were related to my problem.

    The broken database was fortunately only test data, which also could be recovered from a backup.

     
  • FHaselbein2
    FHaselbein2
    2012-04-12

    Hi,

    @fredt: do you mean the database must be created already with 2.2.8 or is it sufficient to open an existing database with this version?

    Bye Michael

     
  • Fred Toussi
    Fred Toussi
    2012-04-12

    It is sufficient to SHUTDOWN the existing database, then switch to 2.2.8.

    To check an existing database for problems, perform either CHECKPOINT DEFRAG or SHUTDOWN COMACT / SHUTDOWN SCRIPT.

    The problem in 2.2.6 and 2.2.7 happens only if the database has CACHED tables and the process is aborted after some extensive change, but before any checkpoint. Therefore there is only a small window for problems to occur and this is why it did not show up in our extensive tests.

     
  • Jimmy
    Jimmy
    2014-01-15

    Hi,

    I know this issue is old, but we just ran exactly in the case described by fredt. We had a hsqldb running for a while, it was not shutdown properly, and now, it cannot be reopened again.

    Regardless of the way I attempted to open the database, it does not work.

    At this point I feel as if there isn't much which can be done to load the database with the hsqldb driver.

    So my question is, is there an unitility somewhere that could help us recover the data from the *.data file? The file's size is 400MB, there must some of the data in there which isn't corrupt.

    Any idea?

    Thanks.

     
  • Fred Toussi
    Fred Toussi
    2014-01-15

    We have developed some utilities for checking and extracting data from databases that did not otherwise open.  Two SupportWare customers sent us databases and we managed to extract most of the data. Join SupportWare if you'd like. We are not able to release the utilities as they require a lot of of manual intervention to extract the data.