cloudfoundry/cloud_controller_ng — pull request #136 by xingzhou (2013-12-13 05:07:30+00:00)
Title: Decrease stager/dea mem when staging/starting app

CC uses stager_advertisement and dea_advertisement to get knowledge of
DEA status, which includes the info like available memory and app
instance count. By default, these ad will be updated in 5 seconds,
but when staging or starting new instance of app, only the app instance
count has increased, we need to decrease the available memory of the
stager and dea as well to let CC get more accurate info of DEAs

There are two places to decrease the available memory, one is staging,
the other one is starting application at specific index

Note that, to keep consistent with the stager_advertisement and
dea_advertisement, decrement mem operation shall be taken on both
stager ad and dea ad who has the same id. The decrement of dea memory
is submitted in the first commit and the decrement of stager memory is in
the second commit