[MCOL-1588] javamcsapi ColumnStoreBulkInsert can't manually be garbage collected Created: 2018-07-24  Updated: 2023-10-26  Resolved: 2018-07-26

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.1.4, 1.1.5
Fix Version/s: 1.1.6

Type: Bug Priority: Critical
Reporter: Jens Röwekamp (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 10, Ubuntu 18.04, CentOS 7


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

 Description   

This example fails through ColumnStoreBulkInsert not being manually garbage collected.
The automated garbage collection doesn't work either and is reported in MCOL-1407.

import com.mariadb.columnstore.api.*;
 
public class MCSAPITest {
    
        public static void main(String[] args) {
        ColumnStoreDriver d = new ColumnStoreDriver();
		for(int i=0; i<Integer.MAX_VALUE; i++){
			ColumnStoreBulkInsert b = d.createBulkInsert("test", "garbage_test", (short)0, 0);
			try{
				b.setColumn(0, i);
				b.setColumn(1, Integer.MAX_VALUE-i);
				b.writeRow();
				b.commit();
			} catch(ColumnStoreException e){
				b.rollback();
				e.printStackTrace();
			} finally{
			  b.delete();
			}
		}
    }
}



 Comments   
Comment by Jens Röwekamp (Inactive) [ 2018-07-24 ]

Changed the memory management of ColumnStoreBulkInsert from swig C++ managed to swig Java managed. Now one is able to manually garbage collect ColumnStoreBulkInsert through its delete() method.

For QA:
Test on all relevant systems
1) that all regression tests pass
2) compile and execute above's example as described in [1] and validate that Java's memory usage doesn't increase and gets over 1GiB.

[1] https://mariadb.com/kb/en/library/columnstore-bulk-write-sdk/#getting-started-with-java

Comment by Daniel Lee (Inactive) [ 2018-07-26 ]

Build verified: 1.1.6-1 source

/root/columnstore/mariadb-columnstore-server
commit 513775738f72ec990d055a5d47e2511e3c0e34dd
Merge: 3c37210 9236098
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Wed Jul 18 09:37:17 2018 +0100

Merge pull request #123 from drrtuy/MCOL-970

MCOL-970 Slow query log now contains original query even in vtable mode

/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit f9f6dc43dd15ad3f2ca2d9e515b1e44028a16183
Merge: ced7eb4 1170b4e
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Tue Jul 24 18:06:24 2018 +0100

Merge pull request #526 from mariadb-corporation/MCOL-1535

Mcol 1535

/root/mariadb-columnstore-tools
commit 0d1ae73afa9521df7002d32b208f859510d54c0a
/root/columnstore/mariadb-columnstore-server
commit 513775738f72ec990d055a5d47e2511e3c0e34dd
Merge: 3c37210 9236098
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Wed Jul 18 09:37:17 2018 +0100

Merge pull request #123 from drrtuy/MCOL-970

MCOL-970 Slow query log now contains original query even in vtable mode

/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit f9f6dc43dd15ad3f2ca2d9e515b1e44028a16183
Merge: ced7eb4 1170b4e
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Tue Jul 24 18:06:24 2018 +0100

Merge pull request #526 from mariadb-corporation/MCOL-1535

Mcol 1535

/root/mariadb-columnstore-tools
commit 0d1ae73afa9521df7002d32b208f859510d54c0a
Author: david hill <david.hill@mariadb.com>
Date: Mon Jun 18 17:05:29 2018 -0500

update version

Executed MCSAPITest for 15 minutes. Java memory utilization remained at about 30 mb.

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