Fix the autodiscovery of memory on osx and linux