I attempted to add more swap space, decrease Jack server's memory but to no avail. There's enough space everywhere, at least as I can see. I did not have this trouble with the previous updates of 8.1 for the same device. Any idea why this task is failing?

Re: AOSP 8.1 f5121 Could not build FEC data

Thank you vey much, indeed. Eventually, I added the verbose option to fec which showed that it was allocating 7,781,822,464 bytes of memory which was obviously too much even with my swap space (my laptop has 10G virtual memory in total). I appreciated your help, cheers!