I recently ran into a memory issues while running flirt. I try to co-register a T1 1mm, 192x192x174 to a functional EPI image (2mm)108x108x72xN, 1.2-1.8 GB. The N number of volumes varies between 430 and 750;
The exact command I run would be something like:

fsl5.0-flirt -in sbbrain_pl1_1.nii -ref images_002_t1mprax1mmiso64chv21001.nii -dof 6 -omat sub1/session_1/epi2struct_transmat.mat

I am mainly interested in generating the transformation matrix to be later used in AROMA. 
When I turn htop on to watch what happens when I run this, it slowly eats up all memory (16 GB) and then keeps munching into the entire 16 GB of swap. This seems to exceed the memory requirement as per below (Mark's guidance).
I thought it might be due to flirt parallelizing the process but I am not sure about that since only one of the 8 cores is actually being used, and only at about 60-70%.    

Any ideas what might be going on? It's a Ubuntu 16.04 based OS. 

Thank you,