Skip to content

Documentation

雾雨魔理沙 edited this page Jul 24, 2021 · 7 revisions

Code Structure

There are 2 things in the MemBalancer:

  • Runtime, which represent a single runtime with its own heap and gc.
  • Controller, which manage a bunch of runtime by controlling memory allowance, occasionally forcing gc + shrink.

Our main contribution is the BalancedController. When all memory has been allocated, BalancedController calculate a score for all runtime and use that score to force some runtime to gc and shrink memory. Note that when all memory is allocated, some runtime may still has memory left - a runtime has both a current memory, and a memory limit (which can grow). The BalancedController considered all memory allocated when the sum of memory limit is greater then the allowance for all the heaps. Alternatively, we can remove the concept of memory limit altogether, and restrict the sum of currently used memory instead. experiment show that this is a good idea. maybe the missing thing in simulator is limiting the amount of optimize() call by time?

Clone this wiki locally