Question about system calls

I had read about the various functionalities of system calls recently in one of my coursebooks and about how they are used to allocate memory for new processes. The book didn't specify whether it was possible to combine multiple memory allocation requests within a single system call. So I asked one of my teachers and they said that it was indeed possible. I feel that this would probably decrease the system's performance in some way but I cannot seem to give a concrete reason for the same.

Could someone explain why the performance drops in this case?

Thank you for your time.

• Okay, Thank you! – qwertybro Jan 28 '20 at 16:24
• Repost from this? cs.stackexchange.com/q/120046/98 Same class? – Raphael Jan 28 '20 at 17:26
• @Raphael, yup, the original version was re-posted word-for-word; see my comment there. – D.W. Jan 28 '20 at 17:32
• As a matter of fact, we are from the same class. – qwertybro Jan 28 '20 at 18:09

In practice your program doesn't make that system call every time you want to allocate memory. Instead, you have a standard library function, such as malloc(), which has a pool of available memory. When you call malloc(), it selects a region of available memory and allocates that to the caller, and keeps track that it has been allocated. When the available memory runs out, then it uses a system call to ask the operating system for a bunch more memory. So, it might only need to invoke the system call infrequently, even if you call malloc() a lot.