code: def _analyse_node_memory(self, event_name, node):
      for memnode in node.mem_node:  # self mem node
          if memnode.type == "Allocate" or memnode.type == "Free":
              if event_name not in self.allocated_items[memnode.place]:
                  self.allocated_items[memnode.place][
                      event_name
                  ] = MemoryItem(event_name, memnode.place, "Allocated")
              self.allocated_items[memnode.place][
                  event_name
              ].add_memory_record(memnode.increase_bytes, memnode.type)
              self.memory_events[memnode.place][
                  (memnode.addr, "Allocated")
              ].append(
                  [
                      memnode.timestamp_ns,
                      memnode.type,
                      event_name,
                      memnode.increase_bytes,
                  ]
              )
  
          elif (
              memnode.type == "ReservedAllocate"
              or memnode.type == "ReservedFree"
          ):
              if event_name not in self.reserved_items[memnode.place]:
                  self.reserved_items[memnode.place][
                      event_name
                  ] = MemoryItem(event_name, memnode.place, "Reserved")
              self.reserved_items[memnode.place][
                  event_name
              ].add_memory_record(memnode.increase_bytes, memnode.type)
              self.memory_events[memnode.place][
                  (memnode.addr, "Reserved")
              ].append(
                  [
                      memnode.timestamp_ns,
                      memnode.type,
                      event_name,
                      memnode.increase_bytes,
                  ]
              )
          self.memory_curve[memnode.place]["Allocated"].append(
              (
                  memnode.timestamp_ns,
                  memnode.current_allocated,
                  event_name,
              )
          )
          self.memory_curve[memnode.place]["Reserved"].append(
              (
                  memnode.timestamp_ns,
                  memnode.current_reserved,
                  event_name,
              )
          )
          self.memory_curve[memnode.place]["PeakAllocated"].append(
              (memnode.timestamp_ns, memnode.peak_allocated, event_name)
          )
          self.memory_curve[memnode.place]["PeakReserved"].append(
              (memnode.timestamp_ns, memnode.peak_reserved, event_name)
          )
          self.peak_allocation_values[memnode.place] = max(
              self.peak_allocation_values[memnode.place],
              memnode.peak_allocated,
          )
          self.peak_reserved_values[memnode.place] = max(
              self.peak_reserved_values[memnode.place],
              memnode.peak_reserved,
          )
  
file_path: VisualDL/visualdl/component/profiler/parser/memory_parser.py
imports: import collections
  from .utils import traverse_tree
label_desc: Use image node_id 3 for calling the MemoryParser obj's underlying member method code with example usage: obj._analyse_node_memory(event_name, node) without return types