add memory and queue