Bug: in memory allocation
hey vinc, when i try to play tetris sound after playing for a while it gives memory allocation panic. mario sound plays fine. but not tetris and starwars they both have the same error.
can you point me to problem. i want to try to fix it. i forked this project to convert it into a unix like os. i and one of my friend have already added syscalls and unix like utility. and did not touch any sys mem, process files. we are trying to learn from it.
if you can guide us that will be helpful.
thanks, akash
hey vinc, i made some progress. it looks like userspace rust binary memory is not getting deallocated. or some kind of bug in it.
Hi,
I made some progress again. i implemented functions for freeing physical memory but it looks like need to keep track of memory in case of virtual memory. your implementation of using CODE_ADDR works but it leads me to not being able to use freed up memory.
If i were able to fix this i will upstream that patch.
thank, akash
hey vinc,
I made a bit of progress a while back. it took me a bit of time to make progress due to me being new to osdev. It seems for load_binary there is no unload_binary i am trying to implement it. If i am successful then i open a pr.
Hi @akashKarmakar02, this is a known issue that exists because I'm not done implementing proper memory management in MOROS. My progress in this area has been pretty slow over the years but it's indeed blocking when you want to call many times a userspace program.
You can see it here because beep is now a userspace program and it's called very often to produce the melody. I also had the issue recently again when calling sleep every second in a loop for tens of minutes.
I see. thanks for the response.
I tracked all the frame allocations happening in a process and its page table and added all the missing deallocations using a new bitmap frame allocator (see #771). There are still some memory leak happening but a lot less than before, and it's now easier to use a lot more RAM which should reduce the issue even further.
I think we can close this issue.
@vinc thanks for the update appriciate the help.