Title: memory leaks on windows when using tinyobj_loader_opt.h · Issue #283 · tinyobjloader/tinyobjloader · GitHub
Open Graph Title: memory leaks on windows when using tinyobj_loader_opt.h · Issue #283 · tinyobjloader/tinyobjloader
X Title: memory leaks on windows when using tinyobj_loader_opt.h · Issue #283 · tinyobjloader/tinyobjloader
Description: Describe the issue After calling "parseObj", lfpAlloc appears to leak memory. This seems to occur when vectors using lfpAlloc are resized, especially during emplace / push_back. This memory leak can be significantly large when loading hu...
Open Graph Description: Describe the issue After calling "parseObj", lfpAlloc appears to leak memory. This seems to occur when vectors using lfpAlloc are resized, especially during emplace / push_back. This memory leak ca...
X Description: Describe the issue After calling "parseObj", lfpAlloc appears to leak memory. This seems to occur when vectors using lfpAlloc are resized, especially during emplace / push_back. This memo...
Opengraph URL: https://github.com/tinyobjloader/tinyobjloader/issues/283
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"memory leaks on windows when using tinyobj_loader_opt.h","articleBody":"**Describe the issue**\r\n\r\nAfter calling \"parseObj\", lfpAlloc appears to leak memory. This seems to occur when vectors using lfpAlloc are resized, especially during emplace / push_back. This memory leak can be significantly large when loading hundreds of OBJ files.\r\n\r\nBy simply removing the \"lfpAlloc\" from all std::vectors used in tinyobj_loader_opt.h, I no longer leak memory.\r\n\r\n**To Reproduce**\r\n1. repeatedly call parseObj. \r\n2. profile memory usage\r\n3. observe a collection of \"lfpAlloc::Node\u003clfpAlloc::Chunk\u003c\u003c\u003e\u003e\"'s that should be free'd once parseOBJ returns, but are not.\r\n\r\nPlease attach minimal and reproducible files(source codes, .obj/.mtl files, etc)\r\n\r\nSee @ogrex 's comment on issue #153. Repro can be done by modifying the \"viewer.cc\" file to repeatedly load a moderately large obj file.\r\n\r\n**Expected behavior**\r\nOn return, parseOBJ should free all existing allocations to \"lfpAlloc::Node\u003clfpAlloc::Chunk\u003c\u003c\u003e\u003e\".\r\nAlternatively, lfpAlloc should be removed as a dependency of tinyobj_loader_opt.h entirely, as this seems to fix the memory leak. I do not notice a significant impact on performance by removing lfpAlloc, however, more testing might be required to validate this is true.\r\n\r\n**Environment**\r\n - TinyObjLoader version: tinyobj_loader_opt.h on d2cb6d2e3466af4cbcd139816a973ba749910025\r\n - OS: Windows 10\r\n - Compiler: MSVC\r\n","author":{"url":"https://github.com/natevm","@type":"Person","name":"natevm"},"datePublished":"2020-10-10T05:12:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/283/tinyobjloader/issues/283"}
| 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:ec551f29-e3eb-eec8-3af3-192264a1f022 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF0E:85314:256239E:3469B47:6970F646 |
| html-safe-nonce | 408be17ef5461a3f48586173d9d829a5ed3385b83f6d9af09afcb15d22ed2ebf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjBFOjg1MzE0OjI1NjIzOUU6MzQ2OUI0Nzo2OTcwRjY0NiIsInZpc2l0b3JfaWQiOiI2MjcwMzU5MzE5OTc5NTU0Mzc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | deafe0243bf966d81aa291c1819c16ace7b9ad1a17e9923b8c45f9321e7dd315 |
| hovercard-subject-tag | issue:718535189 |
| 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/tinyobjloader/tinyobjloader/283/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2aa3854de6cc08c9319f8f69f067e379b8f21bfd47b3175ca16790f3a586f11d/tinyobjloader/tinyobjloader/issues/283 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2aa3854de6cc08c9319f8f69f067e379b8f21bfd47b3175ca16790f3a586f11d/tinyobjloader/tinyobjloader/issues/283 |
| og:image:alt | Describe the issue After calling "parseObj", lfpAlloc appears to leak memory. This seems to occur when vectors using lfpAlloc are resized, especially during emplace / push_back. This memory leak ca... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | natevm |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1b239ebed690c3053869ff31a3b7597834c25673659d63e7b6fd6a9b5d7853de |
| turbo-cache-control | no-preview |
| go-import | github.com/tinyobjloader/tinyobjloader git https://github.com/tinyobjloader/tinyobjloader.git |
| octolytics-dimension-user_id | 61176939 |
| octolytics-dimension-user_login | tinyobjloader |
| octolytics-dimension-repository_id | 5421296 |
| octolytics-dimension-repository_nwo | tinyobjloader/tinyobjloader |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5421296 |
| octolytics-dimension-repository_network_root_nwo | tinyobjloader/tinyobjloader |
| 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 | aeacfd55297f3de5395c83f200ac35d1f474115e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width