<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.2</li>
<li>Operating System version: 国产凝思操作系统6.0.45</li>
<li>Java version: 1.7</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>使用java api的方式调用服务</li>
<li>在非osgi平台时没有问题</li>
<li>在osgi平台使用报错：NotFoundException</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">错误详情</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/18380553/59558444-fb3fde00-9024-11e9-9e6d-d159ca54233f.jpeg"><img src="https://user-images.githubusercontent.com/18380553/59558444-fb3fde00-9024-11e9-9e6d-d159ca54233f.jpeg" alt="1111" style="max-width: 100%;"></a></p>
<h3 dir="auto">解决</h3>
<p dir="auto">通过搜索我找到了，这个<a href="https://blog.csdn.net/paincupid/article/details/51175244" rel="nofollow">https://blog.csdn.net/paincupid/article/details/51175244</a><br>
通过在代码中加入以下语句解决问题：<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/18380553/59558476-9c2e9900-9025-11e9-8534-351f4da86aca.png"><img src="https://user-images.githubusercontent.com/18380553/59558476-9c2e9900-9025-11e9-8534-351f4da86aca.png" alt="image" style="max-width: 100%;"></a><br>
但是，我不知道这样做是否是正确的。</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version: Centos</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">When every RPC comes, the code in <code class="notranslate">TagRouter</code> class will be executed to create a fully new List reference which will increase the memory usage.</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="private &lt;T&gt; List&lt;Invoker&lt;T&gt;&gt; filterInvoker(List&lt;Invoker&lt;T&gt;&gt; invokers, Predicate&lt;Invoker&lt;T&gt;&gt; predicate) {
    return invokers.stream().filter(predicate).collect(Collectors.toList());
}"><pre class="notranslate"><span class="pl-k">private</span> &lt;<span class="pl-smi">T</span>&gt; <span class="pl-s1">List</span>&lt;<span class="pl-s1">Invoker</span>&lt;<span class="pl-s1">T</span>&gt;&gt; <span class="pl-s1">filterInvoker</span>(<span class="pl-smi">List</span>&lt;<span class="pl-smi">Invoker</span>&lt;<span class="pl-smi">T</span>&gt;&gt; <span class="pl-s1">invokers</span>, <span class="pl-smi">Predicate</span>&lt;<span class="pl-smi">Invoker</span>&lt;<span class="pl-smi">T</span>&gt;&gt; <span class="pl-s1">predicate</span>) {
    <span class="pl-k">return</span> <span class="pl-s1">invokers</span>.<span class="pl-en">stream</span>().<span class="pl-en">filter</span>(<span class="pl-s1">predicate</span>).<span class="pl-en">collect</span>(<span class="pl-smi">Collectors</span>.<span class="pl-en">toList</span>());
}</pre></div>