At some time, something else in your process requested memory from the operating system. It is not generally possible to say what without examining your specific process. Candidates include:
- When your program was started, the loader set up memory for your code, constant data, stack, and more. Also, the process that created the new process for your program (possibly the command-line shell) may have had some things in memory that are retained through the process of executing a new program. (For example, I am not sure whether command-line arguments are directly inherited from the parent or are obtained by the start-up code receiving them through some interprocess communication.)
- While your program’s start-up code was running (the code that is started by the loader and that sets up the C environment before calling
main
), it may have requested memory for various purposes (preparing file buffers, initializing a pool of memory for malloc
, and other things), including for its own computations.
- If you called any routines prior to
mmap
, they may have requested memory. For example, buffers may be created when you open files, printf
prepares some workspace for the formatting operations it needs to perform, and malloc
needs additional memory for its own record keeping besides it returns to you.
Essentially, there are various things going on in memory other than just those you observe in plain C code.