def METHOD_NAME(params: dict):
    """Removes specific duplicates"""
    duplicates = {"-Xmx": False, "-Xms": False, "-Xss": False, "-Xmn": False}
    for param_key in reversed(list(params.keys())):
        for dup_key, _ in duplicates.items():
            if param_key.startswith(dup_key):
                if duplicates[dup_key]:
                    del params[param_key]
                else:
                    duplicates[dup_key] = True