* The deferred_deleter() kernel daemon dropped out, if the list with

memory to free was empty, but didn't check the list with objects to
  delete. So those were queued until someone used deferred_free().
  Should fix #3128.
* Run the daemon once a second instead of every five seconds, so memory
  is recycled a little quicker.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28644 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-11-14 01:50:13 +00:00
parent 5c197c7546
commit f8d77bfb1c

View File

@ -1614,7 +1614,7 @@ deferred_deleter(void *arg, int iteration)
{ {
// move entries and deletables to on-stack lists // move entries and deletables to on-stack lists
InterruptsSpinLocker locker(sDeferredFreeListLock); InterruptsSpinLocker locker(sDeferredFreeListLock);
if (sDeferredFreeList.IsEmpty()) if (sDeferredFreeList.IsEmpty() && sDeferredDeletableList.IsEmpty())
return; return;
DeferredFreeList entries; DeferredFreeList entries;
@ -1786,7 +1786,8 @@ heap_init_post_thread()
return sHeapGrowThread; return sHeapGrowThread;
} }
if (register_kernel_daemon(deferred_deleter, NULL, 50) != B_OK) // run the deferred deleter roughly once a second
if (register_kernel_daemon(deferred_deleter, NULL, 10) != B_OK)
panic("heap_init_post_thread(): failed to init deferred deleter"); panic("heap_init_post_thread(): failed to init deferred deleter");
send_signal_etc(sHeapGrowThread, SIGCONT, B_DO_NOT_RESCHEDULE); send_signal_etc(sHeapGrowThread, SIGCONT, B_DO_NOT_RESCHEDULE);