【小松教你手遊開發】【unity實用技能】unity 記憶體除錯方法
http://blog.theknightsofunity.com/profiling-unity-application-profiler-samples/
Profiling Unity Application with Profiler Samples
The Unity Profiler Samples is something that most of Unity users are unaware of. Yet it can be extremely helpful if you want to find out what amount of resources your code takes during the execution.
If you’re already familiar with built-in profiler then you might know that by default it is not profiling all method calls. Also, the Deep Profiling causes large overhead that will significantly slow down your application execution and it even may not be possible to perform the profiling activity at all (Unity can run out of memory). The Profiler Samples are quite useful here.
Profiler Sample is a block of code that starts with Profiler.BeginSample() and ends with Profiler.EndSample() calls. Just like this:
using UnityEngine;
public class NeedsProfiling : MonoBehaviour {
void Update() {
Profiler.BeginSample("My Sample");
Debug.Log("This code is beign profiled");
Profiler.EndSample();
}
}
Normally, you would put it before and after the chunk of code that you want to be profiled. Profiler Sample will record the execution time for you and it will be displayed in the Profiler window without the need to use the Deep Profiling.As you can see, there’s a new entry in the Profiler Hierarchy!
Of course you can add as many Profiler Samples as you want. It’s completely up to you! Don’t worry about adding too many samples. These calls have zero overhead when they are deployed in non-development build.
相關文章
- 【小松教你手遊開發】【unity實用技能】重置scrollpanelUnity
- 【小松教你手遊開發】【unity實用技能】c++ 交叉引用解決方法UnityC++
- 【小松教你手遊開發】【unity實用技能】控制renderQueue解決NGUI與Unity3D物體渲染順序問題UnityNGUI3D
- 【小松教你手遊開發】【unity實用技能】NGUI Scrollview的Reposition的幾個總結UnityNGUIView
- Unity手遊iOS記憶體分析和測試UnityiOS記憶體
- Unity Memory Profiler 記憶體分析Unity記憶體
- Unity效能分析(三)記憶體分析Unity記憶體
- Unity開發者的C#記憶體管理UnityC#記憶體
- Unity開源技能編輯器Unity
- Unity記憶體最佳化(來自uwa)Unity記憶體
- C#開發Unity遊戲教程之Unity中方法的引數C#Unity遊戲
- Unity——技能系統(一)Unity
- Unity——技能系統(二)Unity
- Unity——技能系統(三)Unity
- Unity效能最佳化記憶體最佳化Unity記憶體
- vs斷點除錯unity安卓包斷點除錯Unity安卓
- 【遠端檔案瀏覽器】Unity+Lua開發除錯利器瀏覽器Unity除錯
- 如何讓手遊記憶體佔用更小?從記憶體消耗iOS實時統計開始記憶體iOS
- 【Unity3D開發小遊戲】《戰棋小遊戲》Unity開發教程Unity3D遊戲
- Unity+C#開發筆記(九)| unity連線Excel攏共分幾步| ╭(●`∀´●)╯╰(●’◡’●)╮UnityC#筆記Excel
- 【Unity 3D遊戲開發】在Unity使用NoSQL資料庫方法介紹Unity3D遊戲開發SQL資料庫
- Unity 消消樂開發思路Unity
- Node除錯指南-記憶體篇除錯記憶體
- 記憶體洩漏除錯工具記憶體除錯
- Unity遊戲示例來了,用Unity開源遊戲資源做遊戲,遊戲開發不再難!Unity遊戲開發
- 用Flash、HTML5和Unity開發網頁遊戲的現實HTMLUnity網頁遊戲
- Unity3D Demo專案開發記錄Unity3D
- 【Unity】HoloLens2 開發日記Unity
- ArkTS 的記憶體快照與記憶體洩露除錯記憶體洩露除錯
- 用Unity實現彈反效果Unity
- 【Unity】Addressables下的圖集(SpriteAtlas)記憶體最佳化Unity記憶體
- 記憶體不足(OutOfMemory)的除錯分析記憶體除錯
- Unity Sunny Land開發流程(二)Unity
- Unity開發 資源準備Unity
- Unity3D開發入門教程(四)——用Lua實現元件Unity3D元件
- 遊戲包體太大,記憶體不足?Unity貼圖壓縮注意這幾點遊戲記憶體Unity
- Unity 體積光Unity
- 除錯應用程式記憶體中的神祕問題除錯記憶體