def _standard_pool_name(given_pool_name):
    """Return a standard memory pool name.

    The memory pool names could vary based on the garbage collector enabled.
    This function returns a standard name we could refer to.

    Available collectors :
    https://docs.oracle.com/en/java/javase/11/gctuning/available-collectors.html

    Here is an old gist listing the variations in the names:
    https://gist.github.com/szegedi/1474365

    """

    # mapping of standard memory pool name to all known names.
    pool_name_aliases = {
        "Eden Space": (
            "PS Eden Space",
            "Par Eden Space",
            "G1 Eden Space",
        ),
        "Survivor Space": (
            "PS Survivor Space",
            "Par Survivor Space",
            "G1 Survivor Space",
        ),
        "Tenured Gen": (
            "PS Old Gen",
            "CMS Old Gen",
            "G1 Old Gen",
        ),
    }

    for standard_name, valid_names in pool_name_aliases.items():
        for name in valid_names:
            if name == given_pool_name:
                return standard_name

    # If we can't find an alternative standard name,
    # just return the given memory pool name.
    return given_pool_name