<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Meiryo,'メイリオ',Sans-Serif;">
<p></p>
<div>suga様 水野様<i><br>
<br>
お世話になっております。 石川と申します。</i><br>
</div>
<p>水野様、確認が遅くなりまして申し訳ございません、お心添えいただきありがとうございました。</p>
<p>suga様、大変申し訳ございません、ご対応頂きましたバージョンは公式サイトでリリース頂くことは可能でしょうか。</p>
<p>チームの規定で公式にリリースされたものしか取り扱うことが出来ず、</p>
<p>お手数でございますが、ご検討いただけますと<span class="st"><em>幸甚</em>に存じま</span>す。<br>
</p>
<p></p>
<br>
何卒よろしくお願いいたします。<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>差出人:</b> mayaa-user-bounces@ml.seasar.org &lt;mayaa-user-bounces@ml.seasar.org&gt; が 水野謙 &lt;mizuno.ken@interfactory.co.jp&gt; の代理で送信<br>
<b>送信日時:</b> 2017年1月23日 9:28<br>
<b>宛先:</b> Discussion list for mayaa users<br>
<b>件名:</b> [mayaa-user:1064] Re: ReferenceCacheの不具合報告</font>
<div>&nbsp;</div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">suga さん、<br>
<br>
水野です。迅速な対応ありがとうございます。<br>
<br>
2017年1月22日 21:19 suga &lt;ko.suga@gmail.com&gt;:<br>
&gt; suga です。<br>
&gt;<br>
&gt; この件、下記にて対応しました。<br>
&gt;<br>
&gt; <a href="https://github.com/seasarorg/mayaa/issues/3" id="LPlnk843906">https://github.com/seasarorg/mayaa/issues/3</a>
<div id="LPBorder_GT_14896643279820.6220035106648716" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14896643279770.17798474766430328" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="ImageCell_14896643279780.2909416296318419" style="width: 250px; position: relative; display: table-cell; padding-right: 20px;" colspan="1">
<div id="LPImageContainer_14896643279780.2688456545616049" style="background-color: rgb(255, 255, 255); height: 250px; position: relative; margin: auto; display: table; width: 250px;">
<a id="LPImageAnchor_14896643279780.20837018381901928" style="display: table-cell; text-align: center;" href="https://github.com/seasarorg/mayaa/issues/3" target="_blank"><img style="display: inline-block; max-width: 250px; max-height: 250px; height: 250px; width: 250px; border-width: 0px; vertical-align: bottom;" aria-label="リンク付きのプレビュー画像が選択されました。ダブル タップしてリンクを開きます。" id="LPThumbnailImageID_14896643279780.7564971085910358" height="250" width="250" src="https://avatars3.githubusercontent.com/u/1319421?v=3&amp;s=400"></a></div>
</td>
<td id="TextCell_14896643279790.2448660222150959" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_14896643279790.2887422810917569"></div>
<div id="LPTitle_14896643279790.8673408543710701" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: &quot;Meiryo UI&quot;,&quot;MS UI Gothic&quot;,&quot;MS PGothic&quot;,&quot;MS Pゴシック&quot;,&quot;MS Gothic&quot;,&quot;MS ゴシック&quot;,sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14896643279800.757952374985536" style="text-decoration: none;" href="https://github.com/seasarorg/mayaa/issues/3" target="_blank">ReferenceCacheのcontains, removeが動作しない · Issue #3 ...</a></div>
<div id="LPMetadata_14896643279800.30432827611004254" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: &quot;Meiryo UI&quot;,&quot;MS UI Gothic&quot;,&quot;MS PGothic&quot;,&quot;MS Pゴシック&quot;,&quot;MS Gothic&quot;,&quot;MS ゴシック&quot;,sans-serif; font-size: 14px; line-height: 14px;">
github.com</div>
<div id="LPDescription_14896643279810.8269841544692739" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: &quot;Meiryo UI&quot;,&quot;MS UI Gothic&quot;,&quot;MS PGothic&quot;,&quot;MS Pゴシック&quot;,&quot;MS Gothic&quot;,&quot;MS ゴシック&quot;,sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
[mayaa-user:1061] より。 ReferenceCacheのcontains, removeが動作しない。 addする際にReferenceでwrapしているため、比較する際にはそれを ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
&gt;<br>
&gt;<br>
&gt; 2017年1月17日(火) 9:18 suga &lt;ko.suga@gmail.com&gt;:<br>
&gt;&gt;<br>
&gt;&gt; suga です。<br>
&gt;&gt;<br>
&gt;&gt; ありがとうございます。<br>
&gt;&gt; 私の方でも確認して修正します。<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2017年1月16日(月) 20:16 水野謙 &lt;mizuno.ken@interfactory.co.jp&gt;:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; お世話になっております。<br>
&gt;&gt;&gt; インターファクトリーの水野と申します。私自身がこのMLに投稿するのは初めてですが、<br>
&gt;&gt;&gt; 以前弊社に在籍していた石上さん経由で大変お世話になっておりました。<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; さて表題の件ですが、NamespaceImpl#getInstance および deserialize に書かれている下記ロジックが<br>
&gt;&gt;&gt; 期待通りに動作していないと思われる不具合を発見しました。<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (_cache.contains(namespace) == false) {<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _cache.add(namespace);<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ReferenceCache#add にて、要素を SoftReference 等でラップしてから追加していますが、<br>
&gt;&gt;&gt; contains メソッドは ArrayList の実装がそのまま使われるため、常に false を返していると思われます。<br>
&gt;&gt;&gt; このため、重複する要素が多数 _cache に追加され、弊社本番環境では起動後半日の運用で<br>
&gt;&gt;&gt; 2万を超える要素数となっておりました。<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ArrayList#contains は内部的に indexOf を呼び出しているので、下記のように indexOf を<br>
&gt;&gt;&gt; オーバーライドすることで解消できそうです。<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; public int indexOf(Object o) {<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; size(); i&#43;&#43;) {<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (((Reference)get(i)).get().equals(o)) {<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return i;<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -1;<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; なお、こちらは未検証ですが、URLImpl#setValue にある下記ロジックにも類似の問題がありそうです。<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (_value != null) {<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _cache.remove(this);<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 参考までに本不具合に気付いた経緯についてですが、弊社本番環境にてごくまれに、<br>
&gt;&gt;&gt; 性能が突然極端に低下し、CPUリソースが枯渇する現象が発生しておりました。<br>
&gt;&gt;&gt; スレッドダンプを取得したところNamespaceImpl.getInstanceにてモニタ取得待ちで待機している<br>
&gt;&gt;&gt; スレッドが大量にあり、付近のロジックを調査して発見した次第です。<br>
&gt;&gt;&gt; だいぶ前の話ではありますが、[mayaa-user:1027] にて石川様が報告されている現象も<br>
&gt;&gt;&gt; 同一の原因かもしれません。<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ご確認の上、修正のご検討をいただけますでしょうか。<br>
&gt;&gt;&gt; なお、弊社環境用には既に修正版を作成済みのため、弊社側の状況としては特に急いではおりません。<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; よろしくお願いいたします。<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; 株式会社インターファクトリー&nbsp;&nbsp; 水野 謙<br>
&gt;&gt;&gt; mizuno.ken@interfactory.co.jp<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 〒102-0071<br>
&gt;&gt;&gt; 東京都千代田区富士見2-10-2 飯田橋グラン・ブルーム4階<br>
&gt;&gt;&gt; TEL:03-5211-0056 / FAX:03-5211-0059<br>
&gt;&gt;&gt; <a href="http://www.interfactory.co.jp">http://www.interfactory.co.jp</a><br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; mayaa-user mailing list<br>
&gt;&gt;&gt; mayaa-user@ml.seasar.org<br>
&gt;&gt;&gt; <a href="https://ml.seasar.org/mailman/listinfo/mayaa-user">https://ml.seasar.org/mailman/listinfo/mayaa-user</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; mayaa-user mailing list<br>
&gt; mayaa-user@ml.seasar.org<br>
&gt; <a href="https://ml.seasar.org/mailman/listinfo/mayaa-user">https://ml.seasar.org/mailman/listinfo/mayaa-user</a><br>
<br>
<br>
<br>
-- <br>
株式会社インターファクトリー&nbsp;&nbsp; 水野 謙<br>
mizuno.ken@interfactory.co.jp<br>
<br>
〒102-0071<br>
東京都千代田区富士見2-10-2 飯田橋グラン・ブルーム4階<br>
TEL:03-5211-0056 / FAX:03-5211-0059<br>
<a href="http://www.interfactory.co.jp">http://www.interfactory.co.jp</a><br>
_______________________________________________<br>
mayaa-user mailing list<br>
mayaa-user@ml.seasar.org<br>
<a href="https://ml.seasar.org/mailman/listinfo/mayaa-user">https://ml.seasar.org/mailman/listinfo/mayaa-user</a><br>
</div>
</span></font></div>
</div>
</body>
</html>