From 1aa622b8ca072a4b74f091d97a6eed0e430dbbe4 Mon Sep 17 00:00:00 2001 From: zijie_li <425880365@qq.com> Date: Fri, 6 Sep 2019 22:02:05 +0800 Subject: [PATCH] =?UTF-8?q?#12=20pss=E6=98=BE=E7=A4=BA=E8=B4=9F=E6=95=B0,?= =?UTF-8?q?=E6=95=B0=E5=80=BC=E6=BA=A2=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LuaProfilerClient/Core/Driver/NativeHelper.cs | 6 +++--- LuaProfiler/LuaProfilerClient/Core/Driver/Sample.cs | 2 +- LuaProfiler/LuaProfilerClient/Core/LuaHookSetup.cs | 2 +- .../LuaProfilerServer/Assets/Editor/Common/Sample.cs | 4 ++-- .../Assets/Editor/NetWork/NetWorkServer.cs | 2 +- .../Assets/Editor/TreeView/HistoryCurve.cs | 10 +++++----- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/LuaProfiler/LuaProfilerClient/Core/Driver/NativeHelper.cs b/LuaProfiler/LuaProfilerClient/Core/Driver/NativeHelper.cs index f1765130..2e711734 100644 --- a/LuaProfiler/LuaProfilerClient/Core/Driver/NativeHelper.cs +++ b/LuaProfiler/LuaProfilerClient/Core/Driver/NativeHelper.cs @@ -46,12 +46,12 @@ namespace MikuLuaProfiler public static class NativeHelper { - public static int GetPass() + public static long GetPass() { #if UNITY_5_5_OR_NEWER - return (int)Profiler.GetTotalAllocatedMemoryLong(); + return Profiler.GetTotalAllocatedMemoryLong(); #else - return (int)Profiler.GetTotalAllocatedMemory(); + return Profiler.GetTotalAllocatedMemory(); #endif } diff --git a/LuaProfiler/LuaProfilerClient/Core/Driver/Sample.cs b/LuaProfiler/LuaProfilerClient/Core/Driver/Sample.cs index d0f27bb5..dc273b05 100644 --- a/LuaProfiler/LuaProfilerClient/Core/Driver/Sample.cs +++ b/LuaProfiler/LuaProfilerClient/Core/Driver/Sample.cs @@ -113,7 +113,7 @@ public class Sample : NetBase public int calls; public int frameCount; public float fps; - public int pss; + public long pss; public float power; public int costLuaGC; diff --git a/LuaProfiler/LuaProfilerClient/Core/LuaHookSetup.cs b/LuaProfiler/LuaProfilerClient/Core/LuaHookSetup.cs index cf5dbe71..15de5305 100644 --- a/LuaProfiler/LuaProfilerClient/Core/LuaHookSetup.cs +++ b/LuaProfiler/LuaProfilerClient/Core/LuaHookSetup.cs @@ -48,7 +48,7 @@ public class HookLuaSetup : MonoBehaviour #region field public static float fps { private set; get; } public static int frameCount { private set; get; } - public static int pss { private set; get; } + public static long pss { private set; get; } public static float power { private set; get; } public static LuaDeepProfilerSetting setting { private set; get; } diff --git a/LuaProfiler/LuaProfilerServer/Assets/Editor/Common/Sample.cs b/LuaProfiler/LuaProfilerServer/Assets/Editor/Common/Sample.cs index c2c81aa4..40f68811 100644 --- a/LuaProfiler/LuaProfilerServer/Assets/Editor/Common/Sample.cs +++ b/LuaProfiler/LuaProfilerServer/Assets/Editor/Common/Sample.cs @@ -184,7 +184,7 @@ public class Sample : NetBase public int currentMonoMemory; public long currentTime; public float fps; - public int pss; + public long pss; public float power; public int calls; @@ -475,7 +475,7 @@ public static Sample Deserialize(byte[] data) s.calls = b.ReadInt32(); s.frameCount = b.ReadInt32(); s.fps = b.ReadSingle(); - s.pss = b.ReadInt32(); + s.pss = b.ReadInt64(); s.power = b.ReadSingle(); s.costLuaGC = b.ReadInt32(); s.costMonoGC = b.ReadInt32(); diff --git a/LuaProfiler/LuaProfilerServer/Assets/Editor/NetWork/NetWorkServer.cs b/LuaProfiler/LuaProfilerServer/Assets/Editor/NetWork/NetWorkServer.cs index f6bba300..fde6a6c9 100644 --- a/LuaProfiler/LuaProfilerServer/Assets/Editor/NetWork/NetWorkServer.cs +++ b/LuaProfiler/LuaProfilerServer/Assets/Editor/NetWork/NetWorkServer.cs @@ -352,7 +352,7 @@ public static Sample Deserialize(BinaryReader br) s.calls = br.ReadInt32(); s.frameCount = br.ReadInt32(); s.fps = br.ReadSingle(); - s.pss = br.ReadInt32(); + s.pss = br.ReadInt64(); s.power = br.ReadSingle(); s.costLuaGC = br.ReadInt32(); s.costMonoGC = br.ReadInt32(); diff --git a/LuaProfiler/LuaProfilerServer/Assets/Editor/TreeView/HistoryCurve.cs b/LuaProfiler/LuaProfilerServer/Assets/Editor/TreeView/HistoryCurve.cs index 6d299377..e6c74456 100644 --- a/LuaProfiler/LuaProfilerServer/Assets/Editor/TreeView/HistoryCurve.cs +++ b/LuaProfiler/LuaProfilerServer/Assets/Editor/TreeView/HistoryCurve.cs @@ -51,7 +51,7 @@ public class HistoryCurve private readonly List m_luaMemoryHistory; private readonly List m_monoMemoryHistory; private readonly List m_fpsHistory; - private readonly List m_pssHistory; + private readonly List m_pssHistory; private readonly List m_powerHistory; private LuaDeepProfilerSetting setting = LuaDeepProfilerSetting.Instance; @@ -62,7 +62,7 @@ public HistoryCurve(int count) m_luaMemoryHistory = new List(count); m_monoMemoryHistory = new List(count); m_fpsHistory = new List(count); - m_pssHistory = new List(count); + m_pssHistory = new List(count); m_powerHistory = new List(count); } @@ -486,7 +486,7 @@ public float minPssValue private float m_maxPssValue = 0; private float FindMinPssValue() { - int result = int.MaxValue; + long result = int.MaxValue; int imax = m_pssHistory.Count - 1; int imin = Mathf.Max(imax - RECORD_FRAME_COUNT, 0); for (int i = imax; i >= imin; --i) @@ -514,7 +514,7 @@ public float maxPssValue private float FindMaxPssValue() { - int result = 0; + long result = 0; int imax = m_pssHistory.Count - 1; int imin = Mathf.Max(imax - RECORD_FRAME_COUNT, 0); for (int i = imax; i >= imin; --i) @@ -576,7 +576,7 @@ public int GetPssRecordCount(out float split) } } - public void SlotPssMemory(int value) + public void SlotPssMemory(long value) { addPssCount++; if (value < m_minPssValue || m_minPssValue < 0)