I want to create a module to calculate memory allocations of each process. I searched so much but I couldn't find anyway to make the kernel call my module whenever a process requests memory allocation. Is there any way to do that? if not what is the best performance command for checking if there has been a change in memory so I know when to call ps
for analyzing. I don't want to call ps all the time because that has a very low performance. Currently I'm thinking about using free
or vmstat
. So which one of them or any good option that I'm missing has the best performance?
0 Answers