GetMemoryInfoPublicSpace (statement)

Syntax GetMemoryInfoPublicSpace used, free, total
Description This statement obtains information on the memory usage for storing the values for public variables used in scripts at the module level.
Parameter Description
used Long. The amount of memory in bytes that has been used for public variable space storage.
free Long. The amount of free space to hold new variables.  
total Long. The amount of memory available for public variables.
Example
Public testPublicLong As Long
Public testPublicString As String
Private pv_test As Long
Private pv_testString As String
Type ExampleRect
   left As Integer
   top As Integer
   right As Integer
   bottom As Integer
End Type
Public dd As ExampleRect
Sub OnMouseUp(x As Long, y As Long, flags As Long)
   Dim ssUsed As Long
   Dim ssFree As Long
   Dim ssMax As Long
   Dim psUsed As Long
   Dim psFree As Long
   Dim psMax As Long
   Dim SymUsed As Long
   Dim SymFree As Long
   Dim SymMax As Long
   Dim handlesUsed As Long
   Dim handlesFree As Long
   Dim handlesMax As Long
   Dim memFlags As Long
   testPublicLong = 1200
   pv_testString = 1200
   testPublicString = "constant string to show usage of string space by constants"
   pv_testString = "More data, more data"
   GetMemoryInfoStringSpaceHandles handlesUsed, handlesFree, handlesMax
   GetMemoryInfoStringSpace ssUsed, ssFree, ssMax, memFlags
   GetMemoryInfoPublicSpace psUsed, psFree, psMax
   GetMemoryInfoSymbolSpace SymUsed, SymFree, SymMax
   MsgBox "The current memory information: " + Chr$(13)_
      + "Handles Used = " + Format$(handlesUsed) + Chr$(13)_
      + "Handles Free = " + Format$(handlesFree) + Chr$(13)_
      + "Handles Max = " + Format$(handlesMax) + Chr$(13)_
      + "String Space Used = " + Format$(ssUsed) + Chr$(13)_
      + "String Space Free = " + Format$(ssFree) + Chr$(13)_
      + "String Space Max = " + Format$(ssMax) + Chr$(13)_
      + "Public Space Used = " + Format$(psUsed) + Chr$(13)_
      + "Public Space Free = " + Format$(psFree) + Chr$(13)_
      + "Public Space Max = " + Format$(psMax) + Chr$(13)_
      + "Symbol Space Used = " + Format$(SymUsed) + Chr$(13)_
      + "Symbol Space Free = " + Format$(SymFree) + Chr$(13)_
      + "Symbol Space Max = " + Format$(SymMax)
End Sub
See Also GetMemoryInfoStringSpaceHandles (statement), GetMemoryInfoStringSpace (statement), GetMemoryInfoPublicSpace (statement)