Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#12 pss显示负数,数值溢出问题 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions LuaProfiler/LuaProfilerClient/Core/Driver/NativeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion LuaProfiler/LuaProfilerClient/Core/Driver/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion LuaProfiler/LuaProfilerClient/Core/LuaHookSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
4 changes: 2 additions & 2 deletions LuaProfiler/LuaProfilerServer/Assets/Editor/Common/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class HistoryCurve
private readonly List<int> m_luaMemoryHistory;
private readonly List<int> m_monoMemoryHistory;
private readonly List<float> m_fpsHistory;
private readonly List<int> m_pssHistory;
private readonly List<long> m_pssHistory;
private readonly List<float> m_powerHistory;

private LuaDeepProfilerSetting setting = LuaDeepProfilerSetting.Instance;
Expand All @@ -62,7 +62,7 @@ public HistoryCurve(int count)
m_luaMemoryHistory = new List<int>(count);
m_monoMemoryHistory = new List<int>(count);
m_fpsHistory = new List<float>(count);
m_pssHistory = new List<int>(count);
m_pssHistory = new List<long>(count);
m_powerHistory = new List<float>(count);
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down