The malloc function performs dynamic memory allocation in C and is part of the standard library
Memset is a C standard library function that sets the first N bytes of the block of memory to the specified value (interpreted as an unsigned char)
"It requests memory from the os kernel but the request is not satisfied until the memory is written to with memset . this allows for greater efficiency in the system s memory management but it can result in misleading malloc behaviour"
from question "Strange iOS memory allocation behavior"