<div dir="ltr">Thank you,<div><br><div>But why i can see different results?</div><div><br></div><div>shell function prints:</div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Total bytes free:                            5351936</span><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">and</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">malloc_free_space return             1135128</span></div><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span style="font-size:12.8px">Best regards,</span><br style="font-size:12.8px"><span style="font-size:12.8px">Mikhail</span><br></div></div></div>
<br><div class="gmail_quote">On 9 February 2018 at 01:19, Chris Johns <span dir="ltr"><<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 09/02/2018 00:59, Mikhail Svetkin wrote:<br>
> Hi all,<br>
><br>
> I am trying to investigate memory leak in my application.<br>
><br>
> I check malloc information via malloc_free_space<br>
> and rtems_shell_main_malloc_info and i see after some times that they have<br>
> different results.<br>
><br>
> For example:<br>
> rtems_shell_main_malloc_info prints 2mb and malloc_free_space prints 1mb<br>
><br>
> Which function should i use?<br>
><br>
<br>
</span>There is a malloc shell command if you have the shell working or you could call<br>
the shell command directly:<br>
<br>
[/] # malloc<br>
C Program Heap and RTEMS Workspace are the same.<br>
Number of free blocks:                             298<br>
Largest free block:                          160667680<br>
Total bytes free:                            160971752<br>
Number of used blocks:                            6707<br>
Largest used block:                           33554440<br>
Total bytes used:                             97291328<br>
Size of the allocatable area in bytes:       258263080<br>
Minimum free size ever in bytes:             160926264<br>
Maximum number of free blocks ever:                314<br>
Maximum number of blocks searched ever:             90<br>
Lifetime number of bytes allocated:         1116295560<br>
Lifetime number of bytes freed:             1019006776<br>
Total number of searches:                     28918650<br>
Total number of successful allocations:       28446143<br>
Total number of failed allocations:                  0<br>
Total number of successful frees:             28439436<br>
Total number of successful resizes:                120<br>
<span class="HOEnZb"><font color="#888888"><br>
Chris<br>
</font></span></blockquote></div><br></div>