增加内存占用输出

This commit is contained in:
ww-rm
2025-03-03 22:11:35 +08:00
parent 2c6c1034b1
commit 4aeee25c97
2 changed files with 6 additions and 0 deletions

View File

@@ -66,6 +66,8 @@ namespace SpineViewer.Controls
Program.Logger.Error("Failed to load {} {}", dialog.SkelPath, dialog.AtlasPath); Program.Logger.Error("Failed to load {} {}", dialog.SkelPath, dialog.AtlasPath);
MessageBox.Show(ex.ToString(), "骨骼加载失败", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.ToString(), "骨骼加载失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
Program.Logger.Info($"Current memory usage: {Program.Process.WorkingSet64:N0} Bytes");
} }
/// <summary> /// <summary>
@@ -138,6 +140,8 @@ namespace SpineViewer.Controls
{ {
Program.Logger.Info("{} skel loaded successfully", success); Program.Logger.Info("{} skel loaded successfully", success);
} }
Program.Logger.Info($"Current memory usage: {Program.Process.WorkingSet64:N0} Bytes");
} }
private void listView_SelectedIndexChanged(object sender, EventArgs e) private void listView_SelectedIndexChanged(object sender, EventArgs e)

View File

@@ -1,9 +1,11 @@
using NLog; using NLog;
using System.Diagnostics;
namespace SpineViewer namespace SpineViewer
{ {
internal static class Program internal static class Program
{ {
public static readonly Process Process = Process.GetCurrentProcess();
public static readonly Logger Logger = LogManager.GetCurrentClassLogger(); public static readonly Logger Logger = LogManager.GetCurrentClassLogger();
/// <summary> /// <summary>