getmemorypool patch by Sunny King