Title: Dropping an ifcopenshell.file retains about 145 bytes per instance on v0.9.0 · Issue #9756 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Dropping an ifcopenshell.file retains about 145 bytes per instance on v0.9.0 · Issue #9756 · IfcOpenShell/IfcOpenShell
X Title: Dropping an ifcopenshell.file retains about 145 bytes per instance on v0.9.0 · Issue #9756 · IfcOpenShell/IfcOpenShell
Description: Creating an ifcopenshell.file, filling it and dropping it leaves memory behind on the current v0.9.0 line, and noticeably more than on 0.8.5. I am reporting the measurement, not a diagnosis. Script (current resident size from ps, not pea...
Open Graph Description: Creating an ifcopenshell.file, filling it and dropping it leaves memory behind on the current v0.9.0 line, and noticeably more than on 0.8.5. I am reporting the measurement, not a diagnosis. Script...
X Description: Creating an ifcopenshell.file, filling it and dropping it leaves memory behind on the current v0.9.0 line, and noticeably more than on 0.8.5. I am reporting the measurement, not a diagnosis. Script...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9756
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dropping an ifcopenshell.file retains about 145 bytes per instance on v0.9.0","articleBody":"Creating an `ifcopenshell.file`, filling it and dropping it leaves memory behind on the current v0.9.0 line, and noticeably more than on 0.8.5. I am reporting the measurement, not a diagnosis.\n\n**Script** (current resident size from `ps`, not peak):\n\n```python\nimport ifcopenshell, gc, os, subprocess\ndef rss(): return int(subprocess.check_output([\"ps\", \"-o\", \"rss=\", \"-p\", str(os.getpid())]).strip()) / 1024\ndef make(n):\n f = ifcopenshell.file(schema=\"IFC4\")\n for i in range(n): f.createIfcCartesianPoint((float(i), 0.0, 0.0))\n return f\nprint(\"baseline %.1f MB\" % rss())\nfor r in range(1, 21):\n f = make(40000); del f; gc.collect()\n if r in (1, 5, 10, 20): print(\"round %2d rss %.1f MB\" % (r, rss()))\n```\n\n**Results** (macOS arm64):\n\n| round | 0.9.1a260929 (2026-09-29 alpha wheel, Python 3.13) | 0.8.5 (PyPI, Python 3.11) |\n|---|---|---|\n| baseline | 45.9 MB | 87.1 MB |\n| 1 | 56.5 | 98.3 |\n| 5 | 78.7 | 103.4 |\n| 10 | 106.2 | 109.5 |\n| 20 | 161.4 | 121.8 |\n\nThat is about 5.8 MB retained per 40,000 dropped instances on 0.9.1 (roughly 145 bytes each) against about 1.7 MB on 0.8.5. Controls on 0.9.1: creating and dropping 15 empty files stays flat at 48 MB, and creating and dropping 40,000 Python tuples 20 times stays flat. A colleague's run with parsed files (`ifcopenshell.open` of a written file, dropped 20 times) and with entity plus simple type instances showed the same growth on 0.9.1, about 5 MB per round.\n\nI have not checked whether this is a true leak or allocator fragmentation, and I have not tried `IFOPSH_SAFE_INSTANCE`. It may be related to the ownership question in https://github.com/IfcOpenShell/IfcOpenShell/pull/9624#issuecomment-5886341106. If it is expected for the raw pointer build, a note would be enough; #2471 is the older report of the same symptom.\n\nGenerated with the assistance of an AI coding tool.\n","author":{"url":"https://github.com/petruconduraru","@type":"Person","name":"petruconduraru"},"datePublished":"2026-09-30T19:56:40Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9756"}
| 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:33531d67-32d7-c394-80e2-3aa4d547c5eb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA98:344084:29D5D2:3AF4B7:6B046A72 |
| html-safe-nonce | 4f8f08c9d2dd4e980657d5d29ebbfc8918a6bd015243c8134e473c7e5c166630 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTk4OjM0NDA4NDoyOUQ1RDI6M0FGNEI3OjZCMDQ2QTcyIiwidmlzaXRvcl9pZCI6IjI1NDc2NzkwNzc0MTUwMjExNzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2918e329dc3dbbf954bb9ba81dd64708968becd707b146836b742cf4a8930158 |
| hovercard-subject-tag | issue:5652232588 |
| 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/9756/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b69ff4001a643295a1b519f79ab1c4a85ad2880a348d4cfd622f93dc12eb8f40/IfcOpenShell/IfcOpenShell/issues/9756 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b69ff4001a643295a1b519f79ab1c4a85ad2880a348d4cfd622f93dc12eb8f40/IfcOpenShell/IfcOpenShell/issues/9756 |
| og:image:alt | Creating an ifcopenshell.file, filling it and dropping it leaves memory behind on the current v0.9.0 line, and noticeably more than on 0.8.5. I am reporting the measurement, not a diagnosis. Script... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | petruconduraru |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| 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 | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| 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