Work in progress, mapped_file_stack still needs implementing and memory limits need to be applied properly