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

[R]: Polling thread started by duckdb::duckdb()? #2942

Closed
2 tasks done
krlmlr opened this issue Jan 18, 2022 · 1 comment · Fixed by #3528
Closed
2 tasks done

[R]: Polling thread started by duckdb::duckdb()? #2942

krlmlr opened this issue Jan 18, 2022 · 1 comment · Fixed by #3528

Comments

@krlmlr
Copy link
Collaborator

krlmlr commented Jan 18, 2022

What happens?

I'm observing small but noticeable CPU usage after running duckdb::duckdb(). The load is reduced after the duckdb connector is garbage-collected. Is this expected? Does duckdb start a polling thread of sorts?

To Reproduce

library(duckdb)
#> Loading required package: DBI

Sys.sleep(5)
system('ps -Ao "%cpu comm" | grep "/R$"', intern = TRUE)
#> [1] "  0.0 /Library/Frameworks/R.framework/Resources/bin/exec/R"

duck <- duckdb()
Sys.sleep(5)
system('ps -Ao "%cpu comm" | grep "/R$"', intern = TRUE)
#> [1] "  2.2 /Library/Frameworks/R.framework/Resources/bin/exec/R"

rm(duck)
gc()
#>           used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
#> Ncells  849164 45.4    1323022 70.7         NA  1323022 70.7
#> Vcells 1551623 11.9    8388608 64.0      16384  2927822 22.4
Sys.sleep(10)
system('ps -Ao "%cpu comm" | grep "/R$"', intern = TRUE)
#> [1] "  0.0 /Library/Frameworks/R.framework/Resources/bin/exec/R"

Created on 2022-01-18 by the reprex package (v2.0.1)

Environment (please complete the following information):

  • OS: macOS
  • DuckDB Version: 1114055
  • DuckDB Client: R

Before Submitting

  • Have you tried this on the latest master branch?
  • Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

CC @nbenn.

@Mytherin
Copy link
Collaborator

DuckDB starts some background threads that wait for work to appear. These shouldn’t be doing anything but waiting for tasks to be available, however. Perhaps something happening there?

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 a pull request may close this issue.

3 participants