added tryPackToMemory version for in-RTS