Title: Unable to reclaim memory when using API · Issue #2471 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Unable to reclaim memory when using API · Issue #2471 · IfcOpenShell/IfcOpenShell
X Title: Unable to reclaim memory when using API · Issue #2471 · IfcOpenShell/IfcOpenShell
Description: I've encountered an issue with Python actually reclaiming memory from an opened file loaded into memory. I'm using Python 3.8 with ifcopenshell 0.7.0 from PyPI. A snippet from a function in my case: ifcopenshell_settings = ifcopenshell.g...
Open Graph Description: I've encountered an issue with Python actually reclaiming memory from an opened file loaded into memory. I'm using Python 3.8 with ifcopenshell 0.7.0 from PyPI. A snippet from a function in my case...
X Description: I've encountered an issue with Python actually reclaiming memory from an opened file loaded into memory. I'm using Python 3.8 with ifcopenshell 0.7.0 from PyPI. A snippet from a function in...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/2471
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to reclaim memory when using API","articleBody":"> I've encountered an issue with Python actually reclaiming memory from an opened file loaded into memory.\r\n> \r\n> \r\n> I'm using Python 3.8 with ifcopenshell 0.7.0 from PyPI.\r\n> A snippet from a function in my case:\r\n> ```python\r\n> ifcopenshell_settings = ifcopenshell.geom.settings()\r\n> ifcopenshell_settings.set(ifcopenshell_settings.USE_WORLD_COORDS, True)\r\n> ifcopenshell_settings.set(ifcopenshell_settings.USE_BREP_DATA, True)\r\n> ifcopenshell_settings.set(ifcopenshell_settings.USE_PYTHON_OPENCASCADE, True)\r\n> \r\n> ifc_file = ifcopenshell.open(ifc_filename)\r\n> \r\n> # this doesn't affect garbage collection\r\n> xAxisOrdinate, xAxisAbscissa = ifc_file.by_type(\"IfcProject\")[0].RepresentationContexts[0].TrueNorth.DirectionRatios\r\n> \r\n> site = ifc_file.by_type(\"IfcSite\")[0]\r\n> \r\n> # this line prevents memory reclaim and the ifc_file stays in memory indefinitely\r\n> conversion_pset = ifcopenshell.api.run(\"pset.add_pset\", ifc_file, product=site, name=\"ePSet_MapConversion\")\r\n> ```\r\n> \r\n> After running this snippet multiple times (e.g. in a loop), I'm seeing a memory leak, where the `ifc_file` doesn't get unloaded. After some time this crashes the host (OOM).\r\n> \r\n> Maybe there's something I'm overlooking when opening or using the file? After removing the last line from the snippet - the memory leak is gone.\r\n\r\n_Originally posted by @YaroslavKormushyn in https://github.com/IfcOpenShell/IfcOpenShell/issues/650#issuecomment-1265472998_\r\n ","author":{"url":"https://github.com/aothms","@type":"Person","name":"aothms"},"datePublished":"2022-10-04T07:11:57Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/2471"}
| 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:c9b73486-ee34-a9e6-200b-6358a8583768 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 90F4:F551D:86C193:B4E3C0:6B04A9F0 |
| html-safe-nonce | 088fa1bb078b7c4ae2fbed1b1446e2ccc39fd877a153e818cc168b2235758ad8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEY0OkY1NTFEOjg2QzE5MzpCNEUzQzA6NkIwNEE5RjAiLCJ2aXNpdG9yX2lkIjoiNDIwOTI0ODkwMzE0MjYxNTUzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b89367973f0f407ff4870dda992f9932e2d674f700f48c49432b6dc08889d655 |
| hovercard-subject-tag | issue:1395773387 |
| 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/2471/issue_layout |
| twitter:image | https://opengraph.githubassets.com/287c4c5d3cbee48b0aaabb99817c91fe23edc0d4071f2429dc2563a8f6e3e86b/IfcOpenShell/IfcOpenShell/issues/2471 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/287c4c5d3cbee48b0aaabb99817c91fe23edc0d4071f2429dc2563a8f6e3e86b/IfcOpenShell/IfcOpenShell/issues/2471 |
| og:image:alt | I've encountered an issue with Python actually reclaiming memory from an opened file loaded into memory. I'm using Python 3.8 with ifcopenshell 0.7.0 from PyPI. A snippet from a function in my case... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aothms |
| 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