c# - Why does ReadAllLines work in WPF but not in ConsoleApp -
i doing benchmarking on different ways read csv file , found "wierd" problem. problem being when use method in console application:
var lines = file.readalllines(filename); // outofmemoryexception foreach (var line in lines) { //doing stuff }
i outofmemoryexception, when use same method in wpf project works fine. file im testing on 730mb , know not use readalllines on bigger csv files why method work in wpf application not in console application?
you're using 32 bit process , suffering address space fragmentation. means runtime cannot allocate enough contiguous memory, although in total, enough memory free. wpf might tend have better memory layout.
change project 64 bit.
or, stream file using file.readlines
.
Comments
Post a Comment