What RAM size are you using? Increase your systems' RAM size and try. It has worked for me. If it still does not work, please provide a screenshot of the error.
iFogsim2 supports mobility which is extended from ifogsim. Moreover, mobfogsim is dedicated for mobility support in fog computing which is also an extended version of ifogsim.