I was reading some material on memory allocation in kernel space of a process. even though i know that kernel has some small/limited amount of memory(usually 1GB) but why dynamic allocation of memory through kmalloc()is preferred/recommended on defining large arrays? In other words it is not preferred to allocate large array in kernel space but instead use of dynamically allocated memory is recommended.
My point of contention is that even if a very big array is defined, it will get actual memory only when needed so it will put less pressure on memory. whereas Kmalloc() will assign all demanded memory. 2nd problem is that as kmalloc assign physical memory, finding/preparing demanded size will put extra pressure on system.
But if i read this preference in many sources then there will be some justified reason far away from my reasoning. Can anybody throw light on merits and demerits(if any) for using array and kmalloc() in kernel space
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire