Skip to content

Change duckdb.max_memory/duckdb.memory_limit to integer GUC #883

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

Merged
merged 2 commits into from
Aug 15, 2025

Conversation

YuweiXiao
Copy link
Contributor

Fix #879

@YuweiXiao
Copy link
Contributor Author

This PR breaks using 'GiB' as unit and only allows units such as 'MB', 'GB'.

@JelteF
Copy link
Collaborator

JelteF commented Aug 11, 2025

This PR breaks using 'GiB' as unit and only allows units such as 'MB', 'GB'.

I think that's fine. Can you update the tests accordingly.

@NitinJadhav-postgres
Copy link

Checked Bug #879 - looks good now.

select * from duckdb.query($$ select current_setting('memory_limit') $$);
current_setting('memory_limit')
---------------------------------
1.0 GiB
(1 row)

CALL duckdb.recycle_ddb();
set duckdb.memory_limit = '';
Copy link
Collaborator

@JelteF JelteF Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we allow setting this to -1 or something to represent the "duckdb default"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the value to 0 will use the 'DuckDB default'. It appears that DuckDB determines this default by checking the system spec. I removed this case since it may lead to unstable case.

@JelteF JelteF merged commit 55874e3 into duckdb:main Aug 15, 2025
7 checks passed
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

Successfully merging this pull request may close these issues.

Crash and corruption when modifying memory settings via pg_reload_conf()
3 participants