fix outofheapspace bug