How is space from malloc allocated? Whenever we load a process (which consists of object code, static and global variables, stack and heap space) into main memory it would be of fixed size. But, the program doesn't know in advance how much heap memory is it gonna need? Is there some fixed stack and heap space given to each process of some size in advance? But, then wouldn't it be a waste of space to give same amount of stack and heap space for each process ?

There can  be other possibility that whenever we execute malloc, operating system gives us free space (basically holes) from main memory which is not the part of process. So, process size can increase at runtime. Then, Why is stack and heap space given to a process in the first place?
malloc is a library function that makes use the sbrk system call. The manual page of malloc on Linux says:


  Normally,  malloc() allocates memory from the heap, and adjusts the size of the heap as required, using sbrk(2).


If we now look at sbrk manual page:


   brk() and sbrk() change the location of the  program  break,
   which  defines  the end of the process's data segment (i.e.,
   the program break is the first location after the end of the
   uninitialized  data  segment).  Increasing the program break
   has the effect of allocating memory to the process; decreas
   ing the break deallocates memory.