make es memory usage dynamic