[MCOL-1996] javamcsapi - memory leak during injection Created: 2018-11-30  Updated: 2023-10-26  Resolved: 2021-01-16

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.1.6, 1.2.2
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Jens Röwekamp (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Environment:

all


Issue Links:
Relates
relates to MCOL-1407 mcsapi memory leak - destructor not c... Closed

 Description   

javamcsapi has a memory leak. I assume that some Swig objects aren't garbage collected.

Memory leak is around ~900MiB for following example injection.

import com.mariadb.columnstore.api.*;
 
public class MCSAPITest {
 
        public static void main(String[] args) {
        ColumnStoreDriver d = new ColumnStoreDriver();
        ColumnStoreBulkInsert b = d.createBulkInsert("test", "t1", (short)0, 0);
        long rows = 100000000;
        try {
            for(long i=0; i < rows; i++){
                b.setColumn(0, i);
                b.setColumn(1, rows-i);
                if (i % 1000 == 0){
                   System.out.println(i);
                }
                b.writeRow();
            }
            b.commit();
        }
        catch (ColumnStoreException e) {
            b.rollback();
            e.printStackTrace();
        }
    }
}


Generated at Thu Feb 08 02:32:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.