class_docstr: MemoryTrackingCallbacks can be used to trace and track memory usage
  in rollout workers.
  
  The Memory Tracking Callbacks uses tracemalloc and psutil to track
  python allocations during rollouts,
  in training or evaluation.
  
  The tracking data is logged to the custom_metrics of an episode and
  can therefore be viewed in tensorboard
  (or in WandB etc..)
  
  Add MemoryTrackingCallbacks callback to the tune config
  e.g. { ...'callbacks': MemoryTrackingCallbacks ...}
  
  Note:
      This class is meant for debugging and should not be used
      in production code as tracemalloc incurs
      a significant slowdown in execution speed.
class_docstr_tok: ["MemoryTrackingCallbacks","can","be","used","to","trace","and","track","memory","usage","in","rollout","workers",".","The","Memory","Tracking","Callbacks","uses","tracemalloc","and","psutil","to","track","python","allocations","during","rollouts",",","in","training","or","evaluation",".","The","tracking","data","is","logged","to","the","custom_metrics","of","an","episode","and","can","therefore","be","viewed","in","tensorboard","(","or","in","WandB","etc","..",")","Add","MemoryTrackingCallbacks","callback","to","the","tune","config","e.g",".","{","...","'callbacks","'",":","MemoryTrackingCallbacks","...","}","Note",":","This","class","is","meant","for","debugging","and","should","not","be","used","in","production","code","as","tracemalloc","incurs","a","significant","slowdown","in","execution","speed","."]
code: def __init__(self):
      super().__init__()
  
      # Will track the top 10 lines where memory is allocated
      tracemalloc.start(10)
  
imports: import gc
  import os
  import platform
  import tracemalloc
  from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union
  import gymnasium
  import numpy
  from ray.rllib.core.rl_module.rl_module import RLModule
  from ray.rllib.env.base_env import BaseEnv
  from ray.rllib.env.env_context import EnvContext
  from ray.rllib.evaluation.episode import Episode
  from ray.rllib.evaluation.episode_v2 import EpisodeV2
  from ray.rllib.evaluation.postprocessing import Postprocessing
  from ray.rllib.policy import Policy
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.annotations import override, OverrideToImplementCustomLogic, PublicAPI
  from ray.rllib.utils.deprecation import deprecation_warning
  from ray.rllib.utils.exploration.random_encoder import _MovingMeanStd, compute_states_entropy, update_beta
  from ray.rllib.utils.typing import AgentID, EnvType, EpisodeType, PolicyID
  from ray.tune.callback import _CallbackMeta
  import psutil
label_desc: Use image node_id 1 to create a new MemoryTrackingCallbacks object from inherited base classes: DefaultCallbacks with example: obj = MemoryTrackingCallbacks()