code: def write_memory_dump():
      
      # first do a full garbage collection run
      gc.collect()
      if gc.garbage:
          log.warn(LOG_CHECK, "Unreachabe objects: %s", pprint.pformat(gc.garbage))
      from meliae import scanner
      fo, filename = get_temp_file(mode='wb', suffix='.json', prefix='lcdump_')
      try:
          scanner.dump_all_objects(fo)
      finally:
          fo.close()
      return filename
docs: Dump memory to a temporary filename with the meliae package.
      @return: JSON filename where memory dump has been written to
      @rtype: string