Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory not released in DuckDB-WASM after query execution #1904

Open
frosshirt opened this issue Oct 28, 2024 · 0 comments
Open

Memory not released in DuckDB-WASM after query execution #1904

frosshirt opened this issue Oct 28, 2024 · 0 comments

Comments

@frosshirt
Copy link

frosshirt commented Oct 28, 2024

What happens?

In DuckDB-WASM, memory usage remains high after executing a query and is not released, even after performing additional operations. This is particularly noticeable when running queries on an entire table (e.g., calculating a hash across the table or performing SELECT *). Memory usage stays elevated regardless of subsequent actions.

This behavior can be reproduced with generated data and appears to affect only DuckDB-WASM, not the CLI on Windows or Linux. The issue is also reproducible in the latest version (1.1.2) on shell.duckdb.org.

image

After select:
image

To Reproduce

Example SQL to reproduce:

CREATE TABLE t AS SELECT random() AS value FROM range(1, 10000000);
SELECT hash(string_agg(t::text)) FROM t;

Memory remains high (~2 GB) until DuckDB-WASM is completely terminated.

Running similar queries with new random data does not increase memory usage further. It seems that DuckDB frees the memory, but the WASM worker does not.

Browser/Environment:

Chrome 130 and Firefox (22524)

Device:

Windows

DuckDB-Wasm Version:

1.29.1

DuckDB-Wasm Deployment:

shell.duckdb.org

Full Name:

Fabian Roßhirt

Affiliation:

IBIS Prof. Thome AG

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

No branches or pull requests

1 participant