add memory size check(cannot less than 1024)