class_docstr: Augments early stopping in XGBoost to also consider time_limit, memory usage, and usage of adaptive early stopping methods.
  
  Parameters
  ----------
  rounds : int or tuple
     If int, The possible number of rounds without the trend occurrence.
     If tuple, contains early stopping class as first element and class init kwargs as second element.
class_docstr_tok: ["Augments","early","stopping","in","XGBoost","to","also","consider","time_limit",",","memory","usage",",","and","usage","of","adaptive","early","stopping","methods",".","Parameters","--","--","--","--","--","rounds",":","int","or","tuple","If","int",",","The","possible","number","of","rounds","without","the","trend","occurrence",".","If","tuple",",","contains","early","stopping","class","as","first","element","and","class","init","kwargs","as","second","element","."]
code: def _memory_check(self, model):
      available = ResourceManager.get_available_virtual_mem()
      cur_rss = self._mem_status.memory_info().rss
      if cur_rss < self._mem_init_rss:
          self._mem_init_rss = cur_rss
      estimated_model_size_mb = (cur_rss - self._mem_init_rss) >> 20
      available_mb = available >> 20
  
      model_size_memory_ratio = estimated_model_size_mb / available_mb
  
      if (model_size_memory_ratio > 1.0) or (available_mb < 512):
          logger.warning(
              "Warning: Large XGB model size may cause OOM error if training continues"
          )
          logger.warning(f"Available Memory: {available_mb} MB")
          logger.warning(
              f"Estimated XGB model size: {estimated_model_size_mb} MB"
          )
          if self.verbose:
              logger.warning(
                  f"Warning: Early stopped XGB model prior to optimal result to avoid OOM error. Please increase available memory to avoid subpar model quality.\n"
              )
              logger.warning(
                  f"Early stopping. Best iteration is: \t[{model.attr('best_iteration')}]\t{model.attr('best_score')}"
              )
          return True
      elif self.verbose and (model_size_memory_ratio > 0.25):
          logger.log(15, f"Available Memory: {available_mb} MB")
          logger.log(
              15,
              f"Estimated XGB model size: {estimated_model_size_mb} MB",
          )
      return False
  
file_path: autogluon/tabular/src/autogluon/tabular/models/xgboost/callbacks.py
imports: import logging
  import time
  from xgboost.callback import EarlyStopping
  from autogluon.common.utils.lite import disable_if_lite_mode
  from autogluon.common.utils.resource_utils import ResourceManager
  from autogluon.core.utils.early_stopping import SimpleES
label_desc: Use image node_id 5 for calling the EarlyStoppingCustom obj's underlying member method code with example usage: obj._memory_check(model) and returns: False, True