Added memory debug, removed GC call for #170

This commit is contained in:
Michael J. Seiferling
2018-11-13 10:13:07 -06:00
parent 7dc61e76ab
commit c93af8821f
3 changed files with 33 additions and 3 deletions
+9 -3
View File
@@ -45,6 +45,7 @@ Public Class frmMain
'Developer Debug Flags
Private bProcessDebugMode As Boolean = False
Private bMemoryDebugMode As Boolean = False
WithEvents oFileWatcher As New FileSystemWatcher
@@ -842,6 +843,11 @@ Public Class frmMain
Case "process"
bProcessDebugMode = bDebugEnable
mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation)
Case "memory"
bMemoryDebugMode = bDebugEnable
mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation)
Case Else
mgrCommon.ShowMessage(frmMain_ErrorInvalidMode, New String() {sCommand(1), sCommand(0)}, MsgBoxStyle.Exclamation)
End Select
Case Else
@@ -1972,9 +1978,9 @@ Public Class frmMain
End If
End If
'When GBM is running on Mono (v5.16.0.179) a memory leak occurs. This does not occur on Windows.
'See https://github.com/MikeMaximus/gbm/issues/170 for more details.
If mgrCommon.IsUnix Then GC.Collect()
If bMemoryDebugMode Then
UpdateLog(mgrCommon.FormatString(frmMain_DebugMemoryAllocation, Math.Round(GC.GetTotalMemory(False) / 1000000, 2)), False, ToolTipIcon.Info, True)
End If
End Sub
Private Sub bwMonitor_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwMonitor.DoWork
+18
View File
@@ -3039,6 +3039,15 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Memory Allocation: [PARAM] MB.
'''</summary>
Friend ReadOnly Property frmMain_DebugMemoryAllocation() As String
Get
Return ResourceManager.GetString("frmMain_DebugMemoryAllocation", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Game Backup Monitor Log.
'''</summary>
@@ -3237,6 +3246,15 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Invalid mode([PARAM]) for command [PARAM]..
'''</summary>
Friend ReadOnly Property frmMain_ErrorInvalidMode() As String
Get
Return ResourceManager.GetString("frmMain_ErrorInvalidMode", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to The command [PARAM] requires more parameters..
'''</summary>
+6
View File
@@ -2275,4 +2275,10 @@
<data name="frmIncludeExclude_chkRecurseSubFolders" xml:space="preserve">
<value>Recurse sub-folders</value>
</data>
<data name="frmMain_DebugMemoryAllocation" xml:space="preserve">
<value>Memory Allocation: [PARAM] MB</value>
</data>
<data name="frmMain_ErrorInvalidMode" xml:space="preserve">
<value>Invalid mode([PARAM]) for command [PARAM].</value>
</data>
</root>