c++ - Low RAM usage + frequent allocation/deallocation causes Linux to swap out other programs -
the program working on @ moment processes large amount of data (>32gb). due "pipelining" however, maximum of arround 600 mb present in main memory @ each given time (i checked that, works planned).
if program has finished , switch workspace firefox open, example (but others), takes while till can use again (also hdd highly active while). fact makes me wonder if linux (operating system use) swaps out other programs while program running , why?
i have 4 gb of ram installed on machine , while program active never goes above 2 gb of utilization.
my program allocates/deallocates dynamic memory of 2 different sizes. 32 , 64 mb chunks. written in c++ , use new , delete. should linux not sufficiently smart enough reuse these blocks once freed them , leave other memory untouched?
why linux kick stuff out of memory? other effect have not considered? can work arround problem without writing custom memory management system?
the culprit file caching. news can disable file caching. without caching, software run more quickly, if don't need reload same data later.
you can directly linux apis, suggest use library such boost asio. if software i/o bound, should additionally make use of asynchronous i/o improve performance.
Comments
Post a Comment