U3D MemoryProfiler
MemoryProfiler
Unity 5.3a4 has a new very lowlevel memory profiler API. It can tell you which objects got blamed for how much C++ memory allocations. On IL2CPP and Mono .NET 3.5 platforms, it will also give you a dump of the entire C# heap, as well as C# type descriptions.
This API is too low level for most people to benefit from. The intention is to write a much nicer UI window ontop of this API that will actually be readily useful for many users, in helping them figure out which objects are loaded, which objects take a lot of memory, and most important, why that object is in memory. This repository is that nicer UI window, very much in progress of being built.
A common pattern of "memory leaks" that we see, is if you have a C# class with a static field, that contains a list, that has an object, which has a reference to a big Texture2D. This Texture2D will never be unloaded, because it is still reachable from C#. Figuring out this is the case is not very straightforward. This new memory profiler window will make it straight forward, and if you select the big Texture2D, it will show you a backtrace of references, all the way to the static C# field, (including the classname) that is causing this Texture2D to be loaded.
We have taken the, for us new, approach of shipping the low level API in the Unity product itself, and already opensourcing this memory profiler window long before it is "ready enough to be included in unity proper". We'll develop this window as an opensource project. Contributions are welcomed. At some point we'll feel that the feature is "good enough", at which point we'll most likely ship it out of the box with Unity.
Today, the UI part of this feature is still very rough. We decided to opensource it anyway, as when your project is in a state of "we need to use less memory, what do we do now", you probably care alot more about finding your memory leaks today, then finding them 6 months from now with nicer buttons and user experience.
Usage:
- Make sure you're running Unity 5.3a4 or later for IL2CPP support.
- Make sure you're running Unity 2017.3.0b1 or later for Mono .NET 3.5 support.
- Build an il2cpp project & run it (any il2cpp platform should be fine).
- Open the user project in this repository.
- Open the normal profiler window.
- Connect it to the player as you would normally profile.
- Open the memory profiler window (Window->MemoryProfilerWindow)
Click "SnapShot".
U3D MemoryProfiler的更多相关文章
- U3D DrawCall优化手记
在最近,使用U3D开发的游戏核心部分功能即将完成,中间由于各种历史原因,导致项目存在比较大的问题,这些问题在最后,恐怕只能通过一次彻底的重构来解决 现在的游戏跑起来会有接近130-170个左右的Dra ...
- U3D学习笔记1: HelloWorld
Unity 版本: 5.3.5.f1 Hello World工程 1.新建工程 HelloWorld U3D可选2D和3D游戏 2.新建C#脚本文件 在project栏的assets目录右键-&g ...
- U3D笔记11:47 2016/11/30-15:15 2016/12/19
11:47 2016/11/30Before you can load a level you have to add it to the list of levels used in the gam ...
- 跟我从零基础学习Unity3D开发--初识U3D
首先声明,我也是才开始学,把自己学的记录下来也供一些想要学习的朋友参考,一起努力.希望大家能给我指点一下.切莫喷我. 什么是Unity3d呢? 百度百科------Unity是由Unity Techn ...
- 尝试u3d中将代码与编辑器分离
最近与朋友交流,他一直是做端游,最近接触了u3d以后无法忍受代码与配置文件,美术资源全部纠缠在一起的状况,于是一直在琢磨怎么将编辑器与代码彻底分离. 自己也抽空研究一下,碰到一些问题先记录下来. 首先 ...
- u3d avatar部件的理解
u3d中带动画的fbx文件导入的时候,就会显示一个avatar组件,这个到底干嘛的一直没能很好的理解,翻看网上的介绍,基本都是告诉你,设置humanoid类型动画时,拖拉过去之类,但是这玩意到底存储了 ...
- KSFramework:集成U3D热重载框架 - README
KSFramework KEngine + SLua+ Framework = KSFramework KSFramework是一个整合KEngine.SLua的Unity 5开发框架,并为程序.美术 ...
- U3D中GameObject.Find无法找到元件
U3D中GameObject.Find 如果某元件SetActive(false)了,Find()无法找到 因为Find()只会帮你找出正在活动中的物件,所以在将物件关闭前,我们必须将此物件放至预先定 ...
- U3D杂记
1,点击UI上的登录按钮,从脚本发出ioo.netmanager.SendConnet->进入CS->soketclient.sendconnet...->netmanager调用 ...
随机推荐
- centos6.5部署OpenStack单节点
环境 最小化安装的centos6.5 设置如下: 一.修改基本配置 1.修改主机名为controller [root@localhost ~]# hostname controller [root@l ...
- Java常用的线程池
Java通过Executors提供四种线程池,分别为:newCachedThreadPool创建一个可缓存线程池,如果线程池长度超过处理需要,可灵活回收空闲线程,若无可回收,则新建线程.newFixe ...
- arcgis for android 读取shp文件中文乱码解决方法
设置注册表默认字符,即可解决中文乱码问题. 'dbfDefault' 设置方法1.开始--运行,输入”Regedit“,打开注册表.2.如是用的是 10.x 版本 ArcGIS Desktop,定位到 ...
- 第11章 拾遗3:虚拟局域网(VLAN)
1. 虚拟局域网(VLAN) (1)VLAN是建立在物理网络基础上的一种逻辑子网,它将把一个LAN划分成多个逻辑的局域网(VLAN),每个VLAN是一个广播域,VLAN内的主机间通信就和在一个LAN内 ...
- Unity中进程间通信——使用Protobuf-net序列化与反序列化
基于ProtoBuf协议实现网络传输(上) Protobuf 全称Protocol Buffers 是一种轻便高效的结构化数据存储格式,可以用于结构化数据串行化,很适合做数据存储或 RPC 数据交换格 ...
- tips:Java中的switch的选择因子
tips:Java中的switch的选择因子! /* switch(){ } */ switch的()中的判断条件能是什么类型呢? 事实上,在我们学习c++的了解中,switch的参数是一个能 ...
- 《Linux性能及调优指南》第二章:监控和基准工具2.1-2.2
翻译:飞哥 (http://hi.baidu.com/imlidapeng) 版权所有,尊重他人劳动成果,转载时请注明作者和原始出处及本声明. 原文名称:<Linux Performance a ...
- Android最新版支付宝支付集成
上次集成支付宝支付已经很久了,今天写东西用到了支付宝支付,就大致写一下流程: 去蚂蚁金服下载最新版的Android&IOS端SDK 全部文档 -- 资源下载 -- App支付客户端 下载后解压 ...
- IP地址查询接口API
项目需要根据ip查询pos机设备所在的省份信息,经查询有以下几种免费接口: 1. 淘宝IP API http://ip.taobao.com/service/getIpInfo.php?ip=xxx ...
- LeetCode 失败的尝试 10. regular expression matching & 正则
Regular Expression Matching 看到正则就感觉头大,因为正则用好了就很强大.有挑战的才有意思. 其实没有一点思路.循环的话,不能一一对比,匹配模式解释的是之前的字符.那就先遍历 ...