Open skokenes opened 4 months ago
I believe we have a fix in #65, thanks a lot for the reproduction / investigation.
I fear it is not fixed.
@rrcomtech: can you share a reproduction / some more informations?
Any help in tracking problems down is very welcome
@carlopi Sure, I reduced my code to a minimal example here: Memory Leak Demonstration
It creates 128 workers that create random data and send it to the main thread that puts it into DuckDB. It works fine with SQLite and PostgreSQL, but sadly I see the memory always increasing with DuckDB.
Running any query in duckdb-node leaks memory. Here is a simple test script that creates a connection and then runs a simple
SELECT 42 AS fortytwo
SQL statement every 100ms. The script also publishes memory usage to a file every minute. Memory never stops going up.Here is a chart of the resulting memory stats, when run for 50 minutes on an MBP M2, node v18.18.2, duckdb 0.10.0
After 2 hours
EDIT: updated script to remove recursive call