{"id":13786495,"url":"https://github.com/vasyab/UnityHeapCrawler","last_synced_at":"2025-05-11T22:31:19.791Z","repository":{"id":49380901,"uuid":"130269092","full_name":"vasyab/UnityHeapCrawler","owner":"vasyab","description":"Reflection based heap shapshot tool for Unity game engine","archived":false,"fork":false,"pushed_at":"2018-06-25T08:50:33.000Z","size":266,"stargazers_count":108,"open_issues_count":0,"forks_count":10,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-17T22:36:21.649Z","etag":null,"topics":["csharp","heap","memory-leak","reflection","snapshot","unity","unity3d"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vasyab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-19T20:28:05.000Z","updated_at":"2024-10-19T10:50:46.000Z","dependencies_parsed_at":"2022-08-25T06:10:44.570Z","dependency_job_id":null,"html_url":"https://github.com/vasyab/UnityHeapCrawler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasyab%2FUnityHeapCrawler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasyab%2FUnityHeapCrawler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasyab%2FUnityHeapCrawler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasyab%2FUnityHeapCrawler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vasyab","download_url":"https://codeload.github.com/vasyab/UnityHeapCrawler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253645190,"owners_count":21941312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","heap","memory-leak","reflection","snapshot","unity","unity3d"],"created_at":"2024-08-03T19:01:16.803Z","updated_at":"2025-05-11T22:31:14.766Z","avatar_url":"https://github.com/vasyab.png","language":"C#","readme":"# Unity Heap Crawler\n\nCustomizable heap snapshotting tool for Unity game engine. Can be used to detect memory leaks and analyze high heap usage.\n\n## Features\n1. Reflection-based\n2. Results are plain text (see [output example](snapshot-example/))\n3. Human readable results (objects are traversed using [BFS](https://en.wikipedia.org/wiki/Breadth-first_search))\n4. Differential mode that displays only new objects in all reports (see [diffs output](snapshot-example-diff/))\n5. Enable tracking all root paths for specific types (see [output](snapshot-example/types) and [diffs output](snapshot-example-diff/types))\n6. Little memory overhead - most crawling data is discared after aggregation\n7. Highly customizable - choose between fullness and low memory usage (see [documentation](https://vasyab.github.io/UnityHeapCrawler_Docs/class_unity_heap_crawler_1_1_heap_snapshot_collector.html))\n8. References to destroyed Unity objects that still take heap space are clearly visible\n9. Unity editor is not needed. You can make a snapshot in build\n\n## Motivation\n\nWhen heap consumption and memory leaks became problems in our project I could not find a tool that could make a mono heap snapshot to help me find those leaks.\n* Builtin Memory Profiler (Profiler window in Editor) is good for analyzing native resources but provides only heap size without any details\n* [Unity Memory Profiler](https://bitbucket.org/Unity-Technologies/memoryprofiler) does not collect heap objects on mono runtime (even though patch notes state it does in 2017.1). Also, taking snapshot in our project used up 32GB RAM and that is _without_ heap objects.\n* There is no access to mono runtime in Unity so [mono HeapShot](http://www.mono-project.com/archived/heapshot/) is not an option\n\nCurrent solution relies heavily on ideas and memory estimation code from previous reflection based crawlers - my collegue's [UnityHeapEx](https://github.com/Cotoff/UnityHeapEx) and [UnityHeapDump](https://github.com/Zuntatos/UnityHeapDump) by [Zuntatos](https://github.com/Zuntatos). I could not use them as is due high memory consumption (all references data won't fit in memory) and low results readability.\n\n## Usage\nCreate `HeapSnapshotCollector` class instance and call `Start()` after setting it up. See [usage example](Assets/Sample/SampleMemorySnapshot.cs) for options overview. Check out\n[documentation](https://vasyab.github.io/UnityHeapCrawler_Docs/class_unity_heap_crawler_1_1_heap_snapshot_collector.html) for more detailed options description.\n\n## Issues\n* Static fields in generic types and not detected. User can supply those Type objects manually\n* Type memory usage is an estimation and can be slightly off\n\n## Authors\n* [**Vasily Boldyrev**](https://github.com/vasyab) - _Owlcat Games_\n\n## Credits\n* [Cotoff](https://github.com/Cotoff) for original [UnityHeapEx](https://github.com/Cotoff/UnityHeapEx)\n* [Zuntatos](https://github.com/Zuntatos) for another implementation of the same idea [UnityHeapDump](https://github.com/Zuntatos/UnityHeapDump)\n\n## Licence\n\nThis code is distributed under the terms and conditions of the MIT license.\n","funding_links":[],"categories":["Static Code Analysis"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasyab%2FUnityHeapCrawler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasyab%2FUnityHeapCrawler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasyab%2FUnityHeapCrawler/lists"}