Suppose I want to use malloc() to allocated some memory in the process
for(i = 0; i < SOME_NUM; ++i)
int *x = malloc(sizeof(int *));
What is the biggest number that I can set SOME_NUM to?
In xv6 the physical memory is limited and you can see the constant PHYSTOP which is 224MB
for simplicity reasons. Some of that memory is accommodating kernel code and other stuff, so the rest could be used by a process if needs to consume rest of physical memory.
Note: PHYSTOP could be changed, but then you will have to modify the mappages function to map all pages.
Note 2: pages are being allocated, so you could place PHYSTOP
\ pagesize
in loop. Well I'm cheating here because again, kernel data structures and code are already occupying a portion of physical memory.