RFC eliminating zeroing of heap/workspace

Joel Sherrill joel.sherrill at oarcorp.com
Thu Apr 5 21:25:45 UTC 2007

Eric Norum wrote:
> Nothing in the C standard nor in the RTEMS documentation promises 
> anything about the contents of dynamically allocated memory (other 
> than calloc, and that routine clears the memory itself before handing 
> back the pointer).  I'd say don't bother with the clearing.  A 30x 
> speedup sounds worthwhile to me.
I know from the RTEMS workspace perspective, it would be an error to 
assume that
the memory is zeroed since it wouldn't be in the same state if we ever 
reused an object.

In fairness, this timing was on a 15 Mhz SPARC, so 30 times is probably 
a bit extreme
for more common commercial hardware.  But....

I have attached the simulator performance numbers as a point of reference.
The boot time went from 281.63 to 5.29 ms. :)


> On Apr 5, 2007, at 3:58 PM, Joel Sherrill wrote:
>> Hi,
>> I have done some investigation on a simulator
>> and determined that much of the time required
>> to bring the minimum test from reset to the
>> first task is consumed by zero'ing the
>> C Program Heap and RTEMS Workspace.
>> My testing is on a simulated system which
>> has 4MB of RAM and zeroes all but maybe
>> 64K of it since that is the code and data.
>> It takes 97% of the boot time to clear this
>> much RAM.
>> What's the general sentiment about clearing:
>> + the C program heap
>> + the RTEMS workspace
>> Just wanting opinions and thoughts.
>> --joel
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.com
>> http://rtems.rtems.org/mailman/listinfo/rtems-users
> --Eric Norum <norume at aps.anl.gov>
> Advanced Photon Source
> Argonne National Laboratory
> (630) 252-4793

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: memclear.txt
URL: <http://lists.rtems.org/pipermail/users/attachments/20070405/418e260e/attachment-0001.txt>

More information about the users mailing list