Added in 1.6
$memfree
Returns free ram in megabytes format.