automatically set MEM_MAX MAX_SEND