René's URL Explorer Experiment


Title: increased memory usage in 2.4.0 · Issue #394 · googleapis/python-bigquery · GitHub

Open Graph Title: increased memory usage in 2.4.0 · Issue #394 · googleapis/python-bigquery

X Title: increased memory usage in 2.4.0 · Issue #394 · googleapis/python-bigquery

Description: Version 2.4.0 of the library is allocating much more memory that the previous version, 2.3.1, when running multiple queries. In particular, it seems that the QueryJob object is retaining the results of the query internally, and that memo...

Open Graph Description: Version 2.4.0 of the library is allocating much more memory that the previous version, 2.3.1, when running multiple queries. In particular, it seems that the QueryJob object is retaining the result...

X Description: Version 2.4.0 of the library is allocating much more memory that the previous version, 2.3.1, when running multiple queries. In particular, it seems that the QueryJob object is retaining the result...

Opengraph URL: https://github.com/googleapis/python-bigquery/issues/394

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"increased memory usage in 2.4.0","articleBody":"Version 2.4.0 of the library is allocating much more memory that the previous version, 2.3.1, when running multiple queries.\r\nIn particular, it seems that the `QueryJob` object is retaining the results of the query internally, and that memory is not deallocated.\r\n\r\nI think that the problem is related to https://github.com/googleapis/python-bigquery/pull/374.\r\n\r\n#### Environment details\r\n\r\n  - macOS 11.0.1 (also observing this on Linux in a production environment)\r\n  - Python version: 3.8.6\r\n  - pip version: 20.1.1 \r\n  - `google-cloud-bigquery` version: 2.4.0\r\n\r\n#### Steps to reproduce\r\n\r\nRun the script in the code example with `google-cloud-bigquery` 2.4.0 and 2.3.1 versions.\r\nYou will also need to install:\r\n```\r\ngoogle-cloud-bigquery-storage==2.1.0\r\npandas==1.1.4\r\npsutil==5.7.3\r\n```\r\n\r\nThe outputs on my machine are:\r\n\r\nWith 2.4.0:\r\n```\r\nInitial memory used: 77 MB\r\nMemory used: 642 MB\r\nMemory used: 875 MB\r\nMemory used: 1117 MB\r\nMemory used: 1342 MB\r\nMemory used: 1568 MB\r\nMemory used: 1792 MB\r\nMemory used: 2039 MB\r\nMemory used: 2265 MB\r\nMemory used: 2505 MB\r\nMemory used: 2725 MB\r\n```\r\n\r\nWith 2.3.1:\r\n\r\n```\r\nInitial memory used: 77 MB\r\nMemory used: 97 MB\r\nMemory used: 98 MB\r\nMemory used: 99 MB\r\nMemory used: 99 MB\r\nMemory used: 99 MB\r\nMemory used: 99 MB\r\nMemory used: 100 MB\r\nMemory used: 101 MB\r\nMemory used: 101 MB\r\nMemory used: 101 MB\r\n```\r\n\r\n#### Code example\r\n\r\nPlease note that we are storing a reference to the `QueryJob` objects, but **not** to the resulting DataFrames.\r\n\r\n```python\r\nimport os\r\n\r\nimport psutil\r\nfrom google.cloud import bigquery\r\n\r\nif __name__ == '__main__':\r\n    client = bigquery.Client()\r\n\r\n    process = psutil.Process(os.getpid())\r\n    print(f\"Initial memory used: {process.memory_info().rss / 1e6:.0f} MB\")\r\n\r\n    jobs = []\r\n\r\n    for i in range(10):\r\n        job = client.query(\"SELECT x FROM UNNEST(GENERATE_ARRAY(1, 1000000)) AS x\")\r\n        job.result().to_dataframe()\r\n        jobs.append(job)\r\n        print(f\"Memory used: {process.memory_info().rss / 1e6:.0f} MB\")\r\n```\r\n\r\n\r\n","author":{"url":"https://github.com/pietrodn","@type":"Person","name":"pietrodn"},"datePublished":"2020-11-19T08:05:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/394/python-bigquery/issues/394"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:10fb4cf8-0ffd-a9ae-d0b4-63aaf70d8b82
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD438:BAE90:1149D14:177BEA6:6A4F0F1A
html-safe-nonce5bc9faeb0378f0b8403d1fa3fe8c021f325da9932fe43f547708328245a67488
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDM4OkJBRTkwOjExNDlEMTQ6MTc3QkVBNjo2QTRGMEYxQSIsInZpc2l0b3JfaWQiOiI1NzA2NTkxNTY2MTQ0OTMzNjU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaccf14cf25470b7d64758b2b0d01b27f92dc840a18f4cbedd1251208cc6dabff29
hovercard-subject-tagissue:746344957
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-bigquery/394/issue_layout
twitter:imagehttps://opengraph.githubassets.com/02ac186a684590280a0cdc7c51ec5c61c0e45ee60907a3cb7983b12553022424/googleapis/python-bigquery/issues/394
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/02ac186a684590280a0cdc7c51ec5c61c0e45ee60907a3cb7983b12553022424/googleapis/python-bigquery/issues/394
og:image:altVersion 2.4.0 of the library is allocating much more memory that the previous version, 2.3.1, when running multiple queries. In particular, it seems that the QueryJob object is retaining the result...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepietrodn
hostnamegithub.com
expected-hostnamegithub.com
Noneb92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9
turbo-cache-controlno-preview
go-importgithub.com/googleapis/python-bigquery git https://github.com/googleapis/python-bigquery.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id226992475
octolytics-dimension-repository_nwogoogleapis/python-bigquery
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id226992475
octolytics-dimension-repository_network_root_nwogoogleapis/python-bigquery
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2b8f23afb982271f1b22258a94aede67a6b77760
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-bigquery/issues/394#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-bigquery%2Fissues%2F394
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-bigquery%2Fissues%2F394
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fpython-bigquery
Reloadhttps://github.com/googleapis/python-bigquery/issues/394
Reloadhttps://github.com/googleapis/python-bigquery/issues/394
Reloadhttps://github.com/googleapis/python-bigquery/issues/394
Please reload this pagehttps://github.com/googleapis/python-bigquery/issues/394
googleapis https://github.com/googleapis
python-bigqueryhttps://github.com/googleapis/python-bigquery
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fpython-bigquery
Fork 324 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-bigquery
Star 799 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-bigquery
Code https://github.com/googleapis/python-bigquery
Issues 0 https://github.com/googleapis/python-bigquery/issues
Pull requests 0 https://github.com/googleapis/python-bigquery/pulls
Actions https://github.com/googleapis/python-bigquery/actions
Projects https://github.com/googleapis/python-bigquery/projects
Security and quality 0 https://github.com/googleapis/python-bigquery/security
Insights https://github.com/googleapis/python-bigquery/pulse
Code https://github.com/googleapis/python-bigquery
Issues https://github.com/googleapis/python-bigquery/issues
Pull requests https://github.com/googleapis/python-bigquery/pulls
Actions https://github.com/googleapis/python-bigquery/actions
Projects https://github.com/googleapis/python-bigquery/projects
Security and quality https://github.com/googleapis/python-bigquery/security
Insights https://github.com/googleapis/python-bigquery/pulse
#400https://github.com/googleapis/python-bigquery/pull/400
increased memory usage in 2.4.0https://github.com/googleapis/python-bigquery/issues/394#top
#400https://github.com/googleapis/python-bigquery/pull/400
https://github.com/yoshi-automation
api: bigqueryIssues related to the googleapis/python-bigquery API.https://github.com/googleapis/python-bigquery/issues?q=state%3Aopen%20label%3A%22api%3A%20bigquery%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/python-bigquery/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
https://github.com/pietrodn
pietrodnhttps://github.com/pietrodn
on Nov 19, 2020https://github.com/googleapis/python-bigquery/issues/394#issue-746344957
#374https://github.com/googleapis/python-bigquery/pull/374
yoshi-automationhttps://github.com/yoshi-automation
api: bigqueryIssues related to the googleapis/python-bigquery API.https://github.com/googleapis/python-bigquery/issues?q=state%3Aopen%20label%3A%22api%3A%20bigquery%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/python-bigquery/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.