From 0ce4e02cbac20e8e75fd8571b3c295b9998ff9df Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Tue, 27 Mar 2012 19:38:04 -0500 Subject: [PATCH] Actually release directories again so we don't run out of RAM --- kernel/sys/task.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sys/task.c b/kernel/sys/task.c index e4bb0937..a840160e 100644 --- a/kernel/sys/task.c +++ b/kernel/sys/task.c @@ -87,6 +87,7 @@ void release_directory(page_directory_t * dir) { extern char * default_name; void reap_process(process_t * proc) { + kprintf("Reaping process %d; mem before = %d\n", proc->id, memory_use()); list_free(proc->wait_queue); free(proc->wait_queue); list_free(proc->signal_queue); @@ -102,7 +103,7 @@ void reap_process(process_t * proc) { } proc->fds->refs--; if (proc->fds->refs == 0) { - free(proc->thread.page_directory); + release_directory(proc->thread.page_directory); for (uint32_t i = 0; i < proc->fds->length; ++i) { close_fs(proc->fds->entries[i]); free(proc->fds->entries[i]); @@ -111,6 +112,7 @@ void reap_process(process_t * proc) { free(proc->fds); free((void *)(proc->image.stack - KERNEL_STACK_SIZE)); } + kprintf("Reaped process %d; mem after = %d\n", proc->id, memory_use()); // These things are bad! //delete_process(proc); //free((void *)proc);