Hello everyone,
I have a datafile of 7MB of data, as a csv file.
I load it with the following code into a tableview.
The code works, but even in release mode, my ram memory goes to 4GB, as the file with the data is just 7MB...
What am I doing wrong?
I know for each "cell" a label object is created, is that the reason that it takes so many memory?
I have a datafile of 7MB of data, as a csv file.
I load it with the following code into a tableview.
The code works, but even in release mode, my ram memory goes to 4GB, as the file with the data is just 7MB...
What am I doing wrong?
I know for each "cell" a label object is created, is that the reason that it takes so many memory?
Loading data to tableview:
TV_RAW_DATA.Items.Clear
Dim row() As Object
For i = 0 To List1.Size-1
Cols = Regex.Split(DelimiterInternal(chb_Delimiter.SelectedIndex),List1.Get(i))
'If we have column names, then add the as column name first.
If (chkb_ColumnNamesOnFirstLine.Checked = True) And (i = 0) Then
TV_RAW_DATA.SetColumns(Cols)
Else
'Otherwise, just add the data
row = CreateRow(Cols)
TV_RAW_DATA.Items.Add(row)
End If
Next
Create row function:
Sub CreateRow(Row() As String) As Object()
Dim labels(Row.Length) As Object
For i = 0 To Row.Length - 1
Dim lbl As Label
lbl.Initialize("")
lbl.Text = Row(i)
labels(i) = lbl
Next
Return labels
End Sub