Calculate allocatable size based on available mem
Created by: aroffringa
One-fourth of the total memory is divided over the visibility buffers for all the directions. This should fix issues David is having with memory crashes.
This commit requires the currently unmerged idg calculate-memsize-of-buffer
branch.