Opened on Nov 27, 2003 at 4:57:00 PM
Closed on Jan 20, 2005 at 5:30:16 PM
Last modified on Dec 3, 2006 at 1:31:13 PM
#536 closed defect (fixed)
Heap manager uses memory excessively.
Reported by: | osv2 | Owned by: | Joel Sherrill |
---|---|---|---|
Priority: | lowest | Milestone: | 2 |
Component: | score | Version: | 4.6 |
Severity: | normal | Keywords: | |
Cc: | bugs@…, osv@… | Blocked By: | |
Blocking: |
Description
The change to return pointers aligned to the page_size boundary introduced between revisions 1.3 and 1.4 of the file 'tems/cpukit/score/src/heap.c' results in significant increase of memory usage by every heap in the system. The problem is that the code blindly adds page_size to every allocation request.
For an example taken from the manual where 350 bytes request is made for the heap with page_size=256, the memory spent would be 512+8+256 compared to 512+8 in previous implementation that is 50% overhead compared to previous implementation and 84% overhead total!
For the usual configuration used by workspace and malloc managers where page_size==CPU_HEAP_ALIGNMENT, each allocated peace has additional 4 or 8 bytes overhead compared to previous implementation.
The suggestion is to revert this change and implement special routine, _Heap_Allocate_aligned(the_heap, size, alignment) instead that could be used then to implement memalign() call found in some general purpose allocators. I think I can implement it as soon as the suggestion is accepted.
Release:
RTEMS-4.6
Attachments (3)
Change History (4)
comment:1 Changed on Dec 4, 2003 at 1:34:39 PM by Joel Sherrill
Status: | assigned → waiting |
---|
comment:2 Changed on Jan 20, 2005 at 5:30:16 PM by Joel Sherrill
Status: | waiting → closed |
---|
comment:3 Changed on Jan 21, 2005 at 2:53:05 AM by osv2
Changed on Dec 3, 2006 at 1:31:13 PM by osv2
Attachment: | rtems-cvs-20041221-new-heap-alignment.patch.gz added |
---|
rtems-cvs-20041221-new-heap-alignment.patch.gz
From: Sergei Organov <osv@…>
To: bugs@…
Cc: joel@…, jmj@…, jennifer@…,
Subject: Re: RTEMS Re: rtems/536
Date: 20 Jan 2005 21:53:05 +0300