GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — Avoid running out of memory during slow iteration: set worker_queue maxsize to be 1, and/or make it configurable · Issue #561 · googleapis/python-bigquery
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Avoid running out of memory during slow iteration: set worker_queue maxsize to be 1, and/or make it configurable #561Copy link Copy link Closed Labels api: bigqueryIssues related to the googleapis/python-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design. DescriptionIs your feature request related to a problem? Please describe. When using I think I have tracked it down to the
This means that if items are not pulled from the queue fast enough, then all the memory on the system can be used Describe the solution you'd like I think a reasonable solution would be to set the worker_queue = queue.Queue(maxsize=1) This would still effectively be a buffer size of "number of threads + 1" pages since each thread would fetch into a variable, and then wait if the queue is full. However, it being configurable would also be reasonable I think. Describe alternatives you've considered I've monkey-patched for now, and it seems to work. But ideally, it wouldn't be necessary # ... def _monkey_patch_queue_maxsize_1(): OriginalQueue = queue.Queue class QueueWithMaxsize1(OriginalQueue): def __init__(self): super().__init__(maxsize=1) def _restore(): queue.Queue = OriginalQueue queue.Queue = QueueWithMaxsize1 return _restore # .... query = bqClient.query(sql) result_rows = query.result() ensure_original_queue = _monkey_patch_queue_maxsize_1() pages = result_rows.to_dataframe_iterable(bqStorageClient) for page in pages: ensure_original_queue() # ... something slow, even time.sleep can do it Activity
MetadataMetadataAssigneesLabelsapi: bigqueryIssues related to the googleapis/python-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design. TypeProjectsMilestoneRelationshipsDevelopmentIssue actions | ||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |