[RTEMS Project] #3755: leak in realloc

RTEMS trac trac at rtems.org
Thu Aug 1 21:47:16 UTC 2019


#3755: leak in realloc
--------------------------+---------------------
 Reporter:  Jeffrey Hill  |       Owner:  (none)
     Type:  defect        |      Status:  new
 Priority:  normal        |   Milestone:
Component:  score         |     Version:  4.11
 Severity:  normal        |  Resolution:
 Keywords:  realloc leak  |  Blocked By:
 Blocking:                |
--------------------------+---------------------

Comment (by Jeffrey Hill):

 After some additional testing today, it does appear that after heavy use
 of realloc by the default Lua allocator a somewhat higher magnitude of
 heap fragmentation on RTEMS is observed. I have not compared this with
 other OS, but the result is positive enough on RTEMS that I have left the
 alternative allocator, sans realloc, conditionally built into our
 production systems for RTEMS builds only.

 Furthermore, it does not appear that there is a leak when the default,
 realloc based, Lua allocator is installed, and we are basing our
 conclusions on results from a new "heapSpace" diagnostic based on the code
 below. We see only somewhat more fragmentation in that situation, based on
 the largest free block.

 {{{
      malloc_info( &info );
 -    x = info.Stats.size - (unsigned long)(info.Stats.lifetime_allocated -
 info.Stats.lifetime_freed);
 +    x = info.Free.total;
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/3755#comment:14>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list