Skip to content

TagRouter中,无论Invoker是否被过滤,都会创建新的List对象 #6082

@zjseu

Description

@zjseu
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.3
  • Operating System version: Centos
  • Java version: 1.8

Steps to reproduce this issue

When every RPC comes, the code in TagRouter class will be executed to create a fully new List reference which will increase the memory usage.

private <T> List<Invoker<T>> filterInvoker(List<Invoker<T>> invokers, Predicate<Invoker<T>> predicate) {
    return invokers.stream().filter(predicate).collect(Collectors.toList());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions