Device Memory

Hi All,

Not sure if this has been asked before - had a look but could not find. 

What is the best way to restrict app features depending on device memory limits so as not to go over the max memory of a device?

Will unused code for features not available in lower memory devices take up memory?

Thanks,

Hannes