Post a new topicPost a reply Page 2 of 2   [ 12 posts ]
Go to page Previous  1, 2
Author Message
 Post subject: Re: Does freeMemory() observe the heap?
PostPosted: Tue Jul 17, 2012 2:36 pm 

Joined: Wed Sep 21, 2011 12:21 pm
Posts: 38
Hi,

thanks.

If anyone is interested in printing a fine-grained representation of the memory usage, here is the code:
Code:
extern  unsigned int __data_start;
extern  unsigned int __data_end;
extern  unsigned int __bss_start;
extern  unsigned int __bss_end;
extern  unsigned int __heap_start;
extern  void *__brkval;

void printMemLayout( void )
{
   int stackVal = 0  ;
   USB.println("MEMORY LAYOUT");
   
      
   USB.print(".data:");
   USB.print((int)&__data_start,DEC);
   USB.print("-");
   USB.println((int)&__data_end,DEC);
   
   USB.print(".bss:");
   USB.print((int)&__bss_start,DEC);
   USB.print("-");
   USB.println((int)&__bss_end,DEC);
   
   USB.print("heap:");
   USB.print((int)&__heap_start,DEC);
   USB.print("-");
   USB.println((int)__brkval,DEC);

        USB.print("stack:");
   USB.print((int)&stackVal,DEC);
   USB.print("-");
   USB.println(RAMEND,DEC);
}


Best regards
LR_


Top
 Profile  
 
 Post subject: Re: Does freeMemory() observe the heap?
PostPosted: Mon Jul 23, 2012 9:26 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7516
LR_,

thanks for sharing your code.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 2 of 2   [ 12 posts ]
Go to page Previous  1, 2


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use