added memory detection code

see yast/yast-packager#33

- 3.1.19