I am trying to modify exec.c in minix 3.1.2a to change how it does the allocation for the new process. I am trying to make it free the previous process if there is enough memory with a hole + the current memory used, instead of just enough in the hole. I feel like I'd be able to understand how to do this.

My question, however, is how to test it. I would like to be able to make a hole that is too small for the process to be put in if only the hole in memory is tested, but I want it to be able to fit the process if I first free up the memory of the current running process.

I'm not even sure how I would make processes and run them while looking at memory usage and such. Please let me know your thoughts.