mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
3053. [bug] Under a sustained high query load with a finite
max-cache-size, it was possible for cache memory to be exhausted and not recovered. [RT #23371]
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: heap.c,v 1.39 2010/02/04 23:49:13 tbox Exp $ */
|
||||
/* $Id: heap.c,v 1.40 2011/03/03 04:42:25 each Exp $ */
|
||||
|
||||
/*! \file
|
||||
* Heap implementation of priority queues adapted from the following:
|
||||
@@ -86,8 +86,9 @@ isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare,
|
||||
if (heap == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
heap->magic = HEAP_MAGIC;
|
||||
heap->mctx = mctx;
|
||||
heap->size = 0;
|
||||
heap->mctx = NULL;
|
||||
isc_mem_attach(mctx, &heap->mctx);
|
||||
if (size_increment == 0)
|
||||
heap->size_increment = SIZE_INCREMENT;
|
||||
else
|
||||
@@ -114,7 +115,7 @@ isc_heap_destroy(isc_heap_t **heapp) {
|
||||
isc_mem_put(heap->mctx, heap->array,
|
||||
heap->size * sizeof(void *));
|
||||
heap->magic = 0;
|
||||
isc_mem_put(heap->mctx, heap, sizeof(*heap));
|
||||
isc_mem_putanddetach(&heap->mctx, heap, sizeof(*heap));
|
||||
|
||||
*heapp = NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user