Knowing the Arduino memory capacity
The freeRam() method you are suggesting calculates the "space" between the heap and the stack, thus it returns the free SRAM.

There is no way to calculate free remaining EEPROM (if that is what you are asking), since it just contains some arbitrary data at arbitrary locations. Get the EEPROM capacity from the device data sheet and make sure to write within its boundaries.