Freebsd10 memlimit check and overlength-strings error workaround.

Maybe need to change `%zu` to `%lu` instead of typecast?