rewriting swap usage
debugging