def check_memory(location):
    try:
        import psutil
        pid = os.getpid()
        p = psutil.Process(pid)
        rss = p.memory_info().rss >> 20
        logger.info('memory rss %d MB in host %s at ',
                    rss, socket.gethostname(), location)
    except ImportError:
        logger.warning('import psutil failed')