improve safe heap logging