I had a list of objects. The count of objects in the list is approx 5,06,011.
And it consuming 190MB in ram.
After some time I don't need that list. I cleared the list
list.clear() command clears all objects from that list.
But still, my application consuming 190 MB in ram.
How to dispose the list properly?
public class FileProperty
{
public string Name { get; set; }
public string DirectoryPath { get; set; }
public long LastWriteTime { get; set; }
public long Size { get; set; }
}
void Main()
{
var Sqlite = new SqliteConnection(@"Filename=D:\Work\UserData.db");
var FileProps=Sqlite.Query<FileProperty>("SELECT *FROM FileProperties;").ToList();
//Task completed with that collection
//Now want to free memory
FileProps.Clear();
//But memory not freed
}