本文档主要是对Unity官方教程的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于 Unity2017.3版本
参考链接: https://docs.unity3d.com/Manual/MobileProfiling.html
Profiling
First steps
(未完待续)
Memory
内存
There are two types of memory, Mono memory and Unity memory.
有两种类型的内存:Mono 内存和Unity内存。
Mono memory
Mono 内存
Mono memory handles script objects, wrappers for Unity objects (game objects, assets, components, etc). Garbage Collector cleans up when the allocation does not fit in the available memory or on a System.GC.Collect() call.
Mono内存处理脚本对象,作为Unity对象的封装(游戏的对象、资产、组件等)。当可用内存分配不适合或 System.GC.Collect() 调用时,垃圾收集器就会清理。
Memory is allocated in heap blocks. More can allocated if it cannot fit the data into the allocated block. Heap blocks will be kept in Mono until the app is closed. In other words, Mono does not release any memory used to the OS (Unity 3.x). Once you allocate a certain amount of memory, it is reserved for mono and not available for the OS. Even when you release it, it will become available internally for Mono only and not for the OS. The heap memory value in the Profiler will only increase, never decrease.
内存是在堆块中分配的。如果无法将数据放入已分配的块中,则可以申请分配更多块。堆块将保持在Mono中,直到应用程序关闭。换句话说,Mono并没有释放任何内存到操作系统中(Unity 3.x)。一旦你分配了一定数量的内存,它就会被保留为mono,而不可用于操作系统再分配。即使你释放了它&