• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

vasyab/UnityHeapCrawler: Reflection based heap shapshot tool for Unity game engi ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

vasyab/UnityHeapCrawler

开源软件地址:

https://github.com/vasyab/UnityHeapCrawler

开源编程语言:

C# 100.0%

开源软件介绍:

Unity Heap Crawler

Customizable heap snapshotting tool for Unity game engine. Can be used to detect memory leaks and analyze high heap usage.

Features

  1. Reflection-based
  2. Results are plain text (see output example)
  3. Human readable results (objects are traversed using BFS)
  4. Differential mode that displays only new objects in all reports (see diffs output)
  5. Enable tracking all root paths for specific types (see output and diffs output)
  6. Little memory overhead - most crawling data is discared after aggregation
  7. Highly customizable - choose between fullness and low memory usage (see documentation)
  8. References to destroyed Unity objects that still take heap space are clearly visible
  9. Unity editor is not needed. You can make a snapshot in build

Motivation

When 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.

  • Builtin Memory Profiler (Profiler window in Editor) is good for analyzing native resources but provides only heap size without any details
  • Unity Memory Profiler 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.
  • There is no access to mono runtime in Unity so mono HeapShot is not an option

Current solution relies heavily on ideas and memory estimation code from previous reflection based crawlers - my collegue's UnityHeapEx and UnityHeapDump by Zuntatos. I could not use them as is due high memory consumption (all references data won't fit in memory) and low results readability.

Usage

Create HeapSnapshotCollector class instance and call Start() after setting it up. See usage example for options overview. Check out documentation for more detailed options description.

Issues

  • Static fields in generic types and not detected. User can supply those Type objects manually
  • Type memory usage is an estimation and can be slightly off

Authors

Credits

Licence

This code is distributed under the terms and conditions of the MIT license.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
mlaass/jomohojs: HTML5 Javascript Game Engine发布时间:2022-06-07
下一篇:
thomas-alrek/JSGame: JavaScript + Canvas 2D game engine发布时间:2022-06-07
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap