[SPARK-1777 (partial)] bugfix: make size of requested memory correctly

Author: Zhang, Liye <liye.zhang@intel.com>

Closes #1892 from liyezhang556520/lazy_memory_request and squashes the following commits:

335ab61 [Zhang, Liye] [SPARK-1777 (partial)] bugfix: make size of requested memory correctly

(cherry picked from commit 2bd812639c3d8c62a725fb7577365ef0816f2898)
Signed-off-by: Reynold Xin <rxin@apache.org>