Added memory debug, removed GC call for #170
This commit is contained in:
@@ -45,6 +45,7 @@ Public Class frmMain
|
|||||||
|
|
||||||
'Developer Debug Flags
|
'Developer Debug Flags
|
||||||
Private bProcessDebugMode As Boolean = False
|
Private bProcessDebugMode As Boolean = False
|
||||||
|
Private bMemoryDebugMode As Boolean = False
|
||||||
|
|
||||||
WithEvents oFileWatcher As New FileSystemWatcher
|
WithEvents oFileWatcher As New FileSystemWatcher
|
||||||
|
|
||||||
@@ -842,6 +843,11 @@ Public Class frmMain
|
|||||||
Case "process"
|
Case "process"
|
||||||
bProcessDebugMode = bDebugEnable
|
bProcessDebugMode = bDebugEnable
|
||||||
mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation)
|
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
|
End Select
|
||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
@@ -1972,9 +1978,9 @@ Public Class frmMain
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'When GBM is running on Mono (v5.16.0.179) a memory leak occurs. This does not occur on Windows.
|
If bMemoryDebugMode Then
|
||||||
'See https://github.com/MikeMaximus/gbm/issues/170 for more details.
|
UpdateLog(mgrCommon.FormatString(frmMain_DebugMemoryAllocation, Math.Round(GC.GetTotalMemory(False) / 1000000, 2)), False, ToolTipIcon.Info, True)
|
||||||
If mgrCommon.IsUnix Then GC.Collect()
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub bwMonitor_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwMonitor.DoWork
|
Private Sub bwMonitor_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwMonitor.DoWork
|
||||||
|
|||||||
Generated
+18
@@ -3039,6 +3039,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
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>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Game Backup Monitor Log.
|
''' Looks up a localized string similar to Game Backup Monitor Log.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
@@ -3237,6 +3246,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
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>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to The command [PARAM] requires more parameters..
|
''' Looks up a localized string similar to The command [PARAM] requires more parameters..
|
||||||
'''</summary>
|
'''</summary>
|
||||||
|
|||||||
@@ -2275,4 +2275,10 @@
|
|||||||
<data name="frmIncludeExclude_chkRecurseSubFolders" xml:space="preserve">
|
<data name="frmIncludeExclude_chkRecurseSubFolders" xml:space="preserve">
|
||||||
<value>Recurse sub-folders</value>
|
<value>Recurse sub-folders</value>
|
||||||
</data>
|
</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>
|
</root>
|
||||||
Reference in New Issue
Block a user