Update free memory computation to include cached buffers.
Fix a potential rare corner case.