JavaScript debugging function that logs app's memory usage (heap size).

Source: Martin Wells (https://gist.github.com/martinwells/2968021)