<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def SampleMemoryUsage(self, parser_name):
 """Takes a sample of the memory usage for profiling. Args: parser_name (str):
 name of the parser. """

    if self._memory_profiler:
      used_memory = self._process_information.GetUsedMemory() or 0
      self._memory_profiler.Sample(parser_name, used_memory)