예제 #1
0
파일: memcg.py 프로젝트: carriercomm/vcmmd
    def __init__(self, *args, **kwargs):
        AbstractLoadManager.__init__(self, *args, **kwargs)

        if not self.SUPPORTS_GUARANTEES:
            self.logger.warning("Memory guarantees are not supported by "
                                "the load manager and will be ignored")

        self.unused_mem_estimator = None
        if self.TRACK_UNUSED_MEM:
            if UnusedMemEstimator.is_available():
                if config.MEMCG__MEM_INUSE_TIME != 0:
                    self.unused_mem_estimator = UnusedMemEstimator(
                        config.MEMCG__MEM_INUSE_TIME, self.update, self.logger)
            else:
                self.logger.error("Failed to activate idle memory estimator: "
                                  "Not supported by the kernel")
예제 #2
0
파일: memcg.py 프로젝트: carriercomm/vcmmd
 def shutdown(self):
     if self.unused_mem_estimator:
         self.unused_mem_estimator.shutdown()
     AbstractLoadManager.shutdown(self)
예제 #3
0
파일: memcg.py 프로젝트: carriercomm/vcmmd
 def serve_forever(self):
     if self.unused_mem_estimator:
         threading.Thread(target=self.unused_mem_estimator.
                          serve_forever).start()
     AbstractLoadManager.serve_forever(self)