Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Memory Leaks When Destroying Tables #6

Open
kraftp opened this issue Aug 26, 2020 · 2 comments
Open

Memory Leaks When Destroying Tables #6

kraftp opened this issue Aug 26, 2020 · 2 comments

Comments

@kraftp
Copy link

kraftp commented Aug 26, 2020

I'm observing memory leaks when creating and destroying tables, even when closing all connections properly. Here is some example code:

    MonetDBEmbeddedDatabase.startDatabase(":memory:");
    int numRows = 10000000;
    int[] one = new int[numRows];
    int[] two = new int[numRows];
    int[] three = new int[numRows];
    Object[] cols = new Object[]{one, two, three};

    for (int i = 0; i < 1000; i++) {
        MonetDBEmbeddedConnection embeddedConnection = MonetDBEmbeddedDatabase.createConnection();
        embeddedConnection.executeUpdate("CREATE TABLE t (one int, two int, three int)");
        MonetDBTable t = embeddedConnection.getMonetDBTable("t");
        t.appendColumns(cols);
        t.close();
        embeddedConnection.executeUpdate("DROP TABLE t");
        embeddedConnection.close();
    }

Even though this code destroys every table immediately after creation, when run it will rapidly consume all available memory then crash. It appears that memory consumed by tables populated by appendColumns is not freed when the tables are destroyed. I have not observed this behavior with tables populated in other ways.

@PedroTadim
Copy link
Collaborator

This was a known issue fixed on Jun2020 release. This shall be fixed when MonetDBe gets ported to Java. However I can backport it to the current MonetDBLite version.

@PedroTadim
Copy link
Collaborator

MonetDBe-Java has been released: https://github.com/MonetDBSolutions/MonetDBe-Java

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants