-->
Page 1 of 1

Read out free RAM

PostPosted: Mon Aug 31, 2015 2:53 pm
by brutzler
Is there any function, to read out the actual free RAM-Size?
Found the "ESP.getFreeHeap()", but I think this is something different?

Re: Read out free RAM

PostPosted: Mon Aug 31, 2015 3:10 pm
by kolban
Howdy there .... I think the amount of free heap space is exactly the amount of free RAM usable by your application for allocatable storage. There is probably a second concept called "the stack" which is the amount of RAM usable for storing local variables and subroutine nested return data ... but generally (opinion) the heap is the measurement of usable RAM data.

See also:

https://en.wikipedia.org/wiki/Memory_management#HEAP

Re: Read out free RAM

PostPosted: Mon Aug 31, 2015 3:57 pm
by brutzler
OK thx,

--> gets me ~45500 free "HEAP"

Thought there is only SRAM of 32k??

Re: Read out free RAM

PostPosted: Mon Aug 31, 2015 5:35 pm
by kolban
Aha!! Yes ... I thought there was only 64K of ram .. turns out there is a lot more. There appears to be TWO banks of RAM in the device. One is 80K in size and the other is 32K in size giving us a total of 112K. Apparently, the 32K is used for fast instruction access while the 80K is used for slower (and that is relative) data.

I wish I had more details to offer ... but sadly no.