How to monitor sram on MKR1000

Hello,

I am wondering if there is a way to monitor the SRAM usage for the MKR1000 board. I’ve looked all over the internet and came across two possabilities:

One from Adafruit:

int freeRam () 
{
  extern int __heap_start, *__brkval; 
  int v; 
  return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); 
}

And the memory free library:

#include <MemoryFree.h>

The Memory free library gives me a number near 2048, which is bogus for the MKR1000. I’m guessing the library is only built for a device with 2048 bytes of SRAM. Running the free Ram function from Adafruit gives me the following error:

undefined reference to `__heap_start'
collect2: error: ld returned 1 exit status

Not sure where to look next.

Thank you!