Title: ifcopenshell.geom.iterator memory leak · Issue #6904 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: ifcopenshell.geom.iterator memory leak · Issue #6904 · IfcOpenShell/IfcOpenShell
X Title: ifcopenshell.geom.iterator memory leak · Issue #6904 · IfcOpenShell/IfcOpenShell
Description: Bug Description Memory Leak in ifcopenshell.geom.iterator with use-python-opencascade enabled. I think I've identified memory leak in ifcopenshell.geom.iterator when using PythonOCC. The leaks are particularly noticeable in v0.8.2 and v0...
Open Graph Description: Bug Description Memory Leak in ifcopenshell.geom.iterator with use-python-opencascade enabled. I think I've identified memory leak in ifcopenshell.geom.iterator when using PythonOCC. The leaks are ...
X Description: Bug Description Memory Leak in ifcopenshell.geom.iterator with use-python-opencascade enabled. I think I've identified memory leak in ifcopenshell.geom.iterator when using PythonOCC. The leaks ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/6904
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ifcopenshell.geom.iterator memory leak","articleBody":"### Bug Description\n\n**Memory Leak in ifcopenshell.geom.iterator with use-python-opencascade enabled.**\nI think I've identified memory leak in ifcopenshell.geom.iterator when using PythonOCC. The leaks are particularly noticeable in v0.8.2 and v0.8.3 when use-python-opencascade is set to True.\n\n**Test result:**\nWith occt\n\u003cimg width=\"1260\" height=\"540\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/10f38f06-4f2b-447d-9794-5a72f4a52066\" />\n[mprofile_w_occt.txt](https://github.com/user-attachments/files/21215229/mprofile_w_occt.txt)\n\n**without occt**\n\u003cimg width=\"1260\" height=\"540\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/1208023c-1010-4eb1-bb65-9bef4135b353\" />\n[mprofile_wo_occt.txt](https://github.com/user-attachments/files/21215333/mprofile_wo_occt.txt)\n\n**Workaround**\nCurrently I use following code to mitigate the accumulation of leaking memory.\n``` python\n for i in range(10):\n with ProcessPoolExecutor(max_workers=1) as executor:\n results = list(executor.map(open_ifc, ['test_case.ifc']*20))\n```\n\n### Attachments\n\n[ifc file](https://drive.google.com/file/d/1FOF0LONKJk96UTTaEeYNwJZxISYGSuig/view?usp=drive_link)\n```python\nfrom memory_profiler import profile\n\n\n\nif __name__ == '__main__':\n import pandas as pd\n import jsonlines\n from mri_ifc_tool.maas_ifc_parser import MaasIfcFile\n import ifcopenshell\n \n @profile\n def open_ifc(file_path):\n file = ifcopenshell.open(file_path)\n settings_box = ifcopenshell.geom.settings()\n settings_box.set('use-python-opencascade', True)\n list(ifcopenshell.geom.iterator(settings_box, file, 6))\n \n\n for i in range(200):\n open_ifc('test_case.ifc')\n\n\n``` \n\n[issue_environment.yaml.txt](https://github.com/user-attachments/files/21215619/issue_environment.yaml.txt)\n\n### Debug and Error Output\n\n```true\n\n```","author":{"url":"https://github.com/duming","@type":"Person","name":"duming"},"datePublished":"2025-07-14T12:15:32Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/6904"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cb9c4d33-175c-34fd-0740-2e04bc07d090 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF3E:3CD041:82EDBD:B05732:6B04AA29 |
| html-safe-nonce | dbe02d92fa8e8c57c2e1c734ab2fe323a096e51b1bb7eea151c75d4666b48a6e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjNFOjNDRDA0MTo4MkVEQkQ6QjA1NzMyOjZCMDRBQTI5IiwidmlzaXRvcl9pZCI6IjUxNzYxMTEzNzY1MTQ3MjIzNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | dfbc2b959ddb35610ecab4526e480a7b14b52d31dede5a79aaaa387daf76ec1d |
| hovercard-subject-tag | issue:3228555248 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/6904/issue_layout |
| twitter:image | https://opengraph.githubassets.com/39fadd06ba5bfe57701155972b75efe2ae81c2487c74d01fd40a844a3baa98b7/IfcOpenShell/IfcOpenShell/issues/6904 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/39fadd06ba5bfe57701155972b75efe2ae81c2487c74d01fd40a844a3baa98b7/IfcOpenShell/IfcOpenShell/issues/6904 |
| og:image:alt | Bug Description Memory Leak in ifcopenshell.geom.iterator with use-python-opencascade enabled. I think I've identified memory leak in ifcopenshell.geom.iterator when using PythonOCC. The leaks are ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | duming |
| hostname | github.com |
| expected-hostname | github.com |
| None | 188497a0f45a7aa8f7c866faa1950d1a7f8d82b59416adf549b222ad1d1dd19b |
| turbo-cache-control | no-preview |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 557cfbac6cdb532730c95c90f2cefdc0c4128029 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width