add memory usage code for FreeBSD