try to optimize getting of memory usage