Actually I did several ram optimizations and the malloc version did not register a change, but the above function showed 484 bytes free. And you are having issues with the malloc version, so lets go with the above function till it bites us
I'll put it in the next version.