1

When we look at Gmail login page, we can see the space counting dynamically. What does it represent - does it mean that Google is dynamically increasing it's server space?

What happens in the back end while the Gmail space gets dynamically increased?

enter image description here

2
  • It's just a marketing gimmick. They increase the amount of space available to you on a regularly basis. They just use JavaScript to count up from a particular number. They're not actually dynamically increasing the amount of storage available to you in real time.
    – ale
    Mar 28, 2013 at 13:26
  • 1
    Does anybody know if that counter is still displayed on a google page somewhere? Last time I looked at it I remember it being difficult to find and now I can't find it at all.
    – J.Money
    Feb 28, 2014 at 19:31

1 Answer 1

5

As Al mentioned, it's just a gimmick plus some JavaScript trickery that shows the 'real-time' increase - in practice, the amount is a fixed space which gets increased at regular intervals.

This Stack Overflow answer explains how the JS bit works

This is the code in charge of it. Looks like it is based on a time computation being mapped to a number of Bytes.

function updateQuota() {
  if (!quota_elem) {
  return;
  }
  var now = (new Date()).getTime();
  var i;
  for (i = 0; i < CP.length; i++) {
    if (now < CP[i][0]) {
      break;
    }
  }
  if (i == 0) {
    setTimeout(updateQuota, 1000); 
  } else if (i == CP.length) {
    quota_elem.innerHTML = CP[i - 1][3];
  } else {
    var ts = CP[i - 1][0];
    var bs = CP[i - 1][4];
    quota_elem.innerHTML = format(((now-ts) / (CP[i][0]-ts) * (CP[i][5]-bs)) + bs); 
    setTimeout(updateQuota, 1000); 
  } 
} 

var PAD = '.000000';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.