Menu

memory issues

Help
2015-05-22
2015-05-22
  • abu abdulla

    abu abdulla - 2015-05-22

    Hi,

    I'm converting more than 5,000 mdb files into text using ucanaccess. conversion is in sequence i.e. i will start a connection and close it at the end using:

    Connection con = DriverManager.getConnection("jdbc:ucanaccess://<file>;memory=false"); 
    .....
    con.close();
    

    this will through OutOfMemoryError after 30-40 mdb files. analyzing the memory using visualvm, it seems that the memory is not released after each connection:

    Exception in thread "Thread-13" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOfRange(Arrays.java:3664)
    at java.lang.String.<init>(String.java:201)
    at java.nio.HeapCharBuffer.toString(HeapCharBuffer.java:567)
    at java.nio.CharBuffer.toString(CharBuffer.java:1241)
    at com.healthmarketscience.jackcess.impl.ColumnImpl.decodeUncompressedText(ColumnImpl.java:1325)
    at com.healthmarketscience.jackcess.impl.ColumnImpl.decodeTextValue(ColumnImpl.java:1151)
    at com.healthmarketscience.jackcess.impl.LongValueColumnImpl.readLongStringValue(LongValueColumnImpl.java:244)
    at com.healthmarketscience.jackcess.impl.LongValueColumnImpl.read(LongValueColumnImpl.java:94)
    at com.healthmarketscience.jackcess.impl.ColumnImpl.read(ColumnImpl.java:581)
    at com.healthmarketscience.jackcess.impl.TableImpl.getRowColumn(TableImpl.java:755)
    at com.healthmarketscience.jackcess.impl.TableImpl.getRow(TableImpl.java:661)
    at com.healthmarketscience.jackcess.impl.TableImpl.getRow(TableImpl.java:641)
    at com.healthmarketscience.jackcess.impl.CursorImpl.getCurrentRow(CursorImpl.java:699)
    at com.healthmarketscience.jackcess.impl.CursorImpl$BaseIterator.next(CursorImpl.java:822)
    at com.healthmarketscience.jackcess.impl.CursorImpl$BaseIterator.next(CursorImpl.java:779)
    at net.ucanaccess.converters.LoadJet$TablesLoader.loadTableData(LoadJet.java:764)
    at net.ucanaccess.converters.LoadJet$TablesLoader.loadTablesData(LoadJet.java:928)
    at net.ucanaccess.converters.LoadJet$TablesLoader.loadTables(LoadJet.java:972)
    at net.ucanaccess.converters.LoadJet$TablesLoader.access$3(LoadJet.java:966)
    at net.ucanaccess.converters.LoadJet.loadDB(LoadJet.java:1361)
    at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:236)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:270)
    at classes.ShamelaConvertor$1$1.run(ShamelaConvertor.java:83)
    

    the error is thrown when creating new connection

    any help is appreciated

     
  • Marco Amadei

    Marco Amadei - 2015-05-22

    A part of memory is used by hsqldb until you shutdown the instances.
    Use SingleConnection=true connection parameter to recover the heap space you need.

     
  • abu abdulla

    abu abdulla - 2015-05-22

    thanks, it solved the issue.

     

Log in to post a comment.