Which of these alternatives is the most efficient in terms of memory management?
1. Continually re-using the same View:
Dim SCView As ScrollView
Dim lblTemp As Label
For Counter = 0 to 10000000
SCView.Panel.AddView(lblTemp,....)
.
.
.
lblTemp.RemoveView
Next
2. Creating a new instance of the View every time:
Dim SCView As ScrollView
For Counter = 0 to 10000000
Dim lblTemp As Label
SCView.Panel.AddView(lblTemp,....)
.
.
.
lblTemp.RemoveView
Next
3. Creating a new instance of the View and releasing the memory used by the previous instance. Is this even necessary? What command/ syntax is correct?
Dim SCView As ScrollView
For Counter = 0 to 10000000
Dim lblTemp As Label
SCView.Panel.AddView(lblTemp,....)
.
.
.
lblTemp.RemoveView
lblTemp = Null '*Does this release an object?*'
Next