Thanks for providing this amazing piece of software! I started using MASH-FRET on MacOS and found a small bug related to querying the available memory (see below).
Describe the bug
The memory check upon loading TIF files does not work correctly on MacOS.
To Reproduce
Load TIF file of smaller size than available memory. MASH-FRET displays error that memory is insufficient.
Solution
Can be fixed by minor modification to memAlloc.m by distinguishing between MacOS and Linux-based systems, as follows:
function ok = memAlloc(arr_size)
ok = 1;
if ~contains(computer,'PCWIN') % not Windows platfroms
if ismac % MACOS
[~, w] = system('sysctl hw.memsize | awk ''{print $2}''');
maxsz = str2double(w);
else % LINUX
% from angainor (https://stackoverflow.com/questions/12350598/how-to-access-memory-information-in-matlab-on-unix-equivalent-of-user-view-max)
[~,w] = unix('free -b | grep Mem');
stats = str2double(regexp(w, '[0-9]*', 'match'));
maxsz = stats(end);
end
else
mem = memory;
maxsz = mem.MaxPossibleArrayBytes;
end
if arr_size>=maxsz
ok = 0;
return
end
Hi Richard and Melodie,
Thanks for providing this amazing piece of software! I started using MASH-FRET on MacOS and found a small bug related to querying the available memory (see below).
Describe the bug The memory check upon loading TIF files does not work correctly on MacOS.
To Reproduce Load TIF file of smaller size than available memory. MASH-FRET displays error that memory is insufficient.
Solution Can be fixed by minor modification to memAlloc.m by distinguishing between MacOS and Linux-based systems, as follows: