<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>きぬろぐ &#187; Java</title>
	<atom:link href="http://www.kinusati.net/category/computer/%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%a0/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kinusati.net</link>
	<description>だめでつれづれな日記</description>
	<lastBuildDate>Sun, 15 Jan 2012 23:42:13 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/category/computer/%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%a0/java/feed/" />
		<item>
		<title>JAVAの逆コンパイラ「JD」</title>
		<link>http://www.kinusati.net/2011/02/05/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9%e3%80%8cjd%e3%80%8d/</link>
		<comments>http://www.kinusati.net/2011/02/05/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9%e3%80%8cjd%e3%80%8d/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 02:57:15 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=934</guid>
		<description><![CDATA[JAVAの逆コンパイラに「JD」というものがあります。 JDにはJD-GUIというものと、JD-ECLISPEという二つが存在しており、JD-IDEは逆コンパイラのGUI版、JD-ECLIPSEはECLIPSE上で動作す &#8230; <a href="http://www.kinusati.net/2011/02/05/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9%e3%80%8cjd%e3%80%8d/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>JAVAの逆コンパイラに「<a href="http://java.decompiler.free.fr/">JD</a>」というものがあります。</p>
<p>JDには<a href="http://java.decompiler.free.fr/?q=jdgui">JD-GUI</a>というものと、<a href="http://java.decompiler.free.fr/?q=jdeclipse">JD-ECLISPE</a>という二つが存在しており、JD-IDEは逆コンパイラのGUI版、JD-ECLIPSEはECLIPSE上で動作するJDということになります。</p>
<p>ついこの間、ソースファイルの所在が不明となったJARファイルがあったので、JD-GUIを使って逆コンパイルしてみましたが、びっくりしました！JARファイルを与えたらあっという間に逆コンパイルが完了し、その結果をjavaファイルで出力できるという優れもので・・・</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2011/02/jdide-1.png"><img src="http://www.kinusati.net/wp-content/uploads/2011/02/jdide-1.png" title="jdide-1" width="344" height="251" class="alignnone size-full wp-image-935" /></a></p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2011/02/vim-1.png"><img src="http://www.kinusati.net/wp-content/uploads/2011/02/vim-1.png" title="vim-1" width="509" height="217" class="alignnone size-full wp-image-936" /></a></p>
<p>できあがったjavaファイルは、コメントアウトされて出力されますが、このコメントアウト部分をsed等で切り抜けばソースに早変わりします。</p>
<p>便利ですな。</p>
<p>なおライセンスで逆コンパイルが禁止されている場合もあるので、ご利用時はご注意ください。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2011/02/05/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9%e3%80%8cjd%e3%80%8d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2011/02/05/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9%e3%80%8cjd%e3%80%8d/" />
	</item>
		<item>
		<title>antでのProxy設定メモ</title>
		<link>http://www.kinusati.net/2010/09/07/ant%e3%81%a7%e3%81%aeproxy%e8%a8%ad%e5%ae%9a%e3%83%a1%e3%83%a2/</link>
		<comments>http://www.kinusati.net/2010/09/07/ant%e3%81%a7%e3%81%aeproxy%e8%a8%ad%e5%ae%9a%e3%83%a1%e3%83%a2/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 00:14:00 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=821</guid>
		<description><![CDATA[Proxy配下で直接外部に接続できない環境下でantを利用してjarのダウンロードを行うためのメモ。 http://ant.apache.org/manual/proxy.html jmeterのソースファイルをビルドす &#8230; <a href="http://www.kinusati.net/2010/09/07/ant%e3%81%a7%e3%81%aeproxy%e8%a8%ad%e5%ae%9a%e3%83%a1%e3%83%a2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Proxy配下で直接外部に接続できない環境下でantを利用してjarのダウンロードを行うためのメモ。</p>
<blockquote><p><a href="http://ant.apache.org/manual/proxy.html">http://ant.apache.org/manual/proxy.html</a></p></blockquote>
<p>jmeterのソースファイルをビルドする際にant download_jarsが通るようになりました。楽ちん楽ちん。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2010/09/07/ant%e3%81%a7%e3%81%aeproxy%e8%a8%ad%e5%ae%9a%e3%83%a1%e3%83%a2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2010/09/07/ant%e3%81%a7%e3%81%aeproxy%e8%a8%ad%e5%ae%9a%e3%83%a1%e3%83%a2/" />
	</item>
		<item>
		<title>Javaの逆コンパイラ &#8220;jad&#8221;</title>
		<link>http://www.kinusati.net/2010/08/19/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9-jad/</link>
		<comments>http://www.kinusati.net/2010/08/19/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9-jad/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 21:41:22 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=810</guid>
		<description><![CDATA[以前作成したJARファイルの中身が待ったくわからなかったのでjadを利用してclassファイルから逆コンパイルしたのですが、あまりの簡単さ、およびソースコードのきれいさにびっくりしました。こんな便利なツールが普通に使える &#8230; <a href="http://www.kinusati.net/2010/08/19/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9-jad/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>以前作成したJARファイルの中身が待ったくわからなかったのでjadを利用してclassファイルから逆コンパイルしたのですが、あまりの簡単さ、およびソースコードのきれいさにびっくりしました。こんな便利なツールが普通に使えるって感動ですな。と今更ですが。。。</p>
<p>JADについては以下のページがよくまとまっています。</p>
<ul>
<li><a href="http://d.hatena.ne.jp/tanamon/20090613/1244907632">tanamonの日記</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2010/08/19/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9-jad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2010/08/19/java%e3%81%ae%e9%80%86%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9-jad/" />
	</item>
		<item>
		<title>jmap/jhatについて</title>
		<link>http://www.kinusati.net/2010/08/08/jmapjhat%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/</link>
		<comments>http://www.kinusati.net/2010/08/08/jmapjhat%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 03:02:14 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=793</guid>
		<description><![CDATA[Javaでメモリリークを調査するため、hprofを利用してメモリプロファイルを行うことがある。 「Java SE 6完全攻略」 第5回　プロファイラ hprofとよき相棒 jhat hprofはJVMの起動オプションを指 &#8230; <a href="http://www.kinusati.net/2010/08/08/jmapjhat%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Javaでメモリリークを調査するため、hprofを利用してメモリプロファイルを行うことがある。</p>
<ul>
<li><a href="http://itpro.nikkeibp.co.jp/article/COLUMN/20061102/252525/">「Java SE 6完全攻略」 第5回　プロファイラ hprofとよき相棒 jhat</a></li>
</ul>
<p>hprofはJVMの起動オプションを指定してプロファイルをとる代物であるが、若干もさっとするし、何よりよく落ちる・・・Tomcatを起動していたらTomcatもろとも道連れになり実用に耐えません・・・</p>
<pre>
HPROF ERROR: Cannot allocate malloc memory [hprof_util.c:160]
HPROF TERMINATED PROCESS
</pre>
<p>これでは使い物にならんと思って調べていたら、jmapというツールが存在することを発見。jmapはJVMのPIDを指定することでヒープデータを取得することが可能なツール。これを使えば↑の用にhprofが落ちて困ることは回避可能となる。jmapはJDKに付属している(JREには付属していない)。以下使い方。</p>
<pre>
# jmap -dump:format=b,file=&lt;ダンプファイル&gt; &lt;pid&gt;
</pre>
<p>heapダンプを取得後は、jhatで解析。jhatについては<a href="http://itpro.nikkeibp.co.jp/article/COLUMN/20061102/252525/">「Java SE 6完全攻略」 第5回　プロファイラ hprofとよき相棒 jhat</a>の説明が詳しいので割愛するが、heapダンプサイズが大きい場合、java.lang.OutOfMemoryError: Java heap spaceが出ます。。heapサイズを調整して起動すればいいんですけどね。</p>
<pre>
# jhat -J-Xmx1024m &lt;ダンプファイル&gt;
</pre>
<p>なれてくるとJavaって便利ですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2010/08/08/jmapjhat%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2010/08/08/jmapjhat%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/" />
	</item>
		<item>
		<title>Struts2でcodebehindからConventionに変更</title>
		<link>http://www.kinusati.net/2010/07/25/struts2%e3%81%a7codebehind%e3%81%8b%e3%82%89convention%e3%81%ab%e5%a4%89%e6%9b%b4/</link>
		<comments>http://www.kinusati.net/2010/07/25/struts2%e3%81%a7codebehind%e3%81%8b%e3%82%89convention%e3%81%ab%e5%a4%89%e6%9b%b4/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 10:57:59 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=781</guid>
		<description><![CDATA[Struts 2.1.8でcodebehindを利用してコードを書いていたのだが、Action評価後にリダイレクトさせるやり方がわからなかった。 どのページを見ても出来るようなことは書いてますが、どうやってもうまくいかな &#8230; <a href="http://www.kinusati.net/2010/07/25/struts2%e3%81%a7codebehind%e3%81%8b%e3%82%89convention%e3%81%ab%e5%a4%89%e6%9b%b4/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Struts 2.1.8でcodebehindを利用してコードを書いていたのだが、Action評価後にリダイレクトさせるやり方がわからなかった。</p>
<p>どのページを見ても出来るようなことは書いてますが、どうやってもうまくいかない・・。</p>
<p>理由は結局わからなかったのですが、調査していて気がついたのは「Struts 2.1系からcodebehindプラグインはdeprecate」ですという事実。</p>
<p>これはまずいと思って、Conventionプラグインを利用する用に変更しました。変更方法は<a href="http://struts.apache.org/2.x/docs/converting-application-from-codebehind-to-convention-plugin.html">このページ</a>によくまとまっています。</p>
<p>一番注意が必要な点は「Action名からリクエストに変換するルールが異なる」と言うこと。結局JSP側も修正しましたよ。ふぅ。</p>
<pre>
<pre>
Previously in Codebehind:
Given an action named AnExampleAction, a request to /anExample -&gt; AnExampleAction.execute() -&gt; &gt; anExample-index.ftl
Now in Convention:
Given an action named AnExampleAction, a request to /an-example -&gt; AnExampleAction.execute() -&gt; an-example-index.ftl
</pre>
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2010/07/25/struts2%e3%81%a7codebehind%e3%81%8b%e3%82%89convention%e3%81%ab%e5%a4%89%e6%9b%b4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2010/07/25/struts2%e3%81%a7codebehind%e3%81%8b%e3%82%89convention%e3%81%ab%e5%a4%89%e6%9b%b4/" />
	</item>
		<item>
		<title>Javaのheap設定&amp;調査コマンドメモ</title>
		<link>http://www.kinusati.net/2010/07/22/java%e3%81%aeheap%e8%a8%ad%e5%ae%9a%e8%aa%bf%e6%9f%bb%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%83%a1%e3%83%a2/</link>
		<comments>http://www.kinusati.net/2010/07/22/java%e3%81%aeheap%e8%a8%ad%e5%ae%9a%e8%aa%bf%e6%9f%bb%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%83%a1%e3%83%a2/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 21:23:34 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=776</guid>
		<description><![CDATA[コマンドメモです。 -Xrunhprof:heap=sites -verbose:gc -XX:+PrintGCDetails -XX:-PrintTenuringDistribution -XX:+PrintHeapA &#8230; <a href="http://www.kinusati.net/2010/07/22/java%e3%81%aeheap%e8%a8%ad%e5%ae%9a%e8%aa%bf%e6%9f%bb%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%83%a1%e3%83%a2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>コマンドメモです。</p>
<pre>
-Xrunhprof:heap=sites -verbose:gc -XX:+PrintGCDetails -XX:-PrintTenuringDistribution -XX:+PrintHeapAtGC -Xms1024m -Xmx1024m  -XX:PermSize=128m -XX:MaxPermSize=128m
</pre>
<p><span id="more-776"></span></p>
<p>2010/08/08追記)</p>
<p>上記のオプションだと動きが遅いので以下オプション+必要時にjmapでheapダンプをとる方向に変更。</p>
<pre>
-verbose:gc -XX:+PrintGCDetails -XX:-PrintTenuringDistribution -XX:+PrintHeapAtGC -Xms1024m -Xmx1024m  -XX:PermSize=128m -XX:MaxPermSize=128m
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2010/07/22/java%e3%81%aeheap%e8%a8%ad%e5%ae%9a%e8%aa%bf%e6%9f%bb%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%83%a1%e3%83%a2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2010/07/22/java%e3%81%aeheap%e8%a8%ad%e5%ae%9a%e8%aa%bf%e6%9f%bb%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%83%a1%e3%83%a2/" />
	</item>
		<item>
		<title>Hibernateが難しい</title>
		<link>http://www.kinusati.net/2010/07/19/hibernate%e3%81%8c%e9%9b%a3%e3%81%97%e3%81%84/</link>
		<comments>http://www.kinusati.net/2010/07/19/hibernate%e3%81%8c%e9%9b%a3%e3%81%97%e3%81%84/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 00:49:35 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=765</guid>
		<description><![CDATA[Hibernate + Struts2を利用してアプリを書いているのですが、原因不明なことで詰まることが多い。 Hibernateの動きを正しく理解していないことがどうやら原因のようだ。 Hibernateトラブルシュー &#8230; <a href="http://www.kinusati.net/2010/07/19/hibernate%e3%81%8c%e9%9b%a3%e3%81%97%e3%81%84/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hibernate + Struts2を利用してアプリを書いているのですが、原因不明なことで詰まることが多い。</p>
<p>Hibernateの動きを正しく理解していないことがどうやら原因のようだ。</p>
<ul>
<li><a href="http://www.itarchitect.jp/enterprise/-/20114.html">Hibernateトラブルシューティング</a></li>
</ul>
<p>ここをみて、目から鱗。ちゃんと調べないとだめだという典型例でした・・</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2010/07/19/hibernate%e3%81%8c%e9%9b%a3%e3%81%97%e3%81%84/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2010/07/19/hibernate%e3%81%8c%e9%9b%a3%e3%81%97%e3%81%84/" />
	</item>
		<item>
		<title>JVMに指定するオプション</title>
		<link>http://www.kinusati.net/2010/07/11/jvm%e3%81%ab%e6%8c%87%e5%ae%9a%e3%81%99%e3%82%8b%e3%82%aa%e3%83%97%e3%82%b7%e3%83%a7%e3%83%b3/</link>
		<comments>http://www.kinusati.net/2010/07/11/jvm%e3%81%ab%e6%8c%87%e5%ae%9a%e3%81%99%e3%82%8b%e3%82%aa%e3%83%97%e3%82%b7%e3%83%a7%e3%83%b3/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 09:07:18 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=756</guid>
		<description><![CDATA[とりあえずのメモ。 メモリの利用状況を調査するためにJVMに以下のオプションを指定する。 &#8220;-Xrunhprof:heap=sites -verbose:gc&#8221;]]></description>
			<content:encoded><![CDATA[<p>とりあえずのメモ。</p>
<p>メモリの利用状況を調査するためにJVMに以下のオプションを指定する。</p>
<p>&#8220;-Xrunhprof:heap=sites -verbose:gc&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2010/07/11/jvm%e3%81%ab%e6%8c%87%e5%ae%9a%e3%81%99%e3%82%8b%e3%82%aa%e3%83%97%e3%82%b7%e3%83%a7%e3%83%b3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2010/07/11/jvm%e3%81%ab%e6%8c%87%e5%ae%9a%e3%81%99%e3%82%8b%e3%82%aa%e3%83%97%e3%82%b7%e3%83%a7%e3%83%b3/" />
	</item>
		<item>
		<title>Eclipseでメモリリーク調査</title>
		<link>http://www.kinusati.net/2010/07/11/eclipse%e3%81%a7%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af%e8%aa%bf%e6%9f%bb/</link>
		<comments>http://www.kinusati.net/2010/07/11/eclipse%e3%81%a7%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af%e8%aa%bf%e6%9f%bb/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 08:14:39 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=733</guid>
		<description><![CDATA[Struts２を利用してアプリを書いているのだが、なぜかメモリリークする・・・おかしい。このままだとまずいので、今回はEclipse 3.6(Helios)にプロファイラのEclipse Test and Perform &#8230; <a href="http://www.kinusati.net/2010/07/11/eclipse%e3%81%a7%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af%e8%aa%bf%e6%9f%bb/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Struts２を利用してアプリを書いているのだが、なぜかメモリリークする・・・おかしい。このままだとまずいので、今回はEclipse 3.6(Helios)にプロファイラのEclipse Test and Performance Tools Platform(Eclipse TPTP)をインストールして、メモリリークの調査しました。</p>
<h3>インストール</h3>
<p>1. 「ヘルプ」=&gt;「新規ソフトウェアのインストール」を選択</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000000.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000000.png" title="WS000000" width="386" height="211" class="alignnone size-full wp-image-736" /></a></p>
<p>2. 「作業対象」を「すべての使用使用可能なサイト」を]選択し、「テストおよびパフォーマンス」を選択する。</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000001.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000001.png" title="WS000001" width="388" height="269" class="alignnone size-full wp-image-737" /></a></p>
<p>3. 選択項目を確認する。</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000002.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000002.png" title="WS000002" width="388" height="269" class="alignnone size-full wp-image-738" /></a></p>
<p>4. ライセンスに同意する</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000003.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000003.png" title="WS000003" width="388" height="269" class="alignnone size-full wp-image-739" /></a></p>
<p>5. ソフトウェア更新作業後、Eclipseの再起動を促されるため、再起動実施。</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000004.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000004.png" title="WS000004" width="332" height="58" class="alignnone size-full wp-image-740" /></a></p>
<h3>プロファイル</h3>
<p>1. プロファイル対象プログラムを選択し、右クリックから「プロファイル(P)」=&gt;「プロファイルの構成(P)」を選択する。</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000005.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000005.png" title="WS000005" width="386" height="340" class="alignnone size-full wp-image-741" /></a></p>
<p>2. 「プロファイル」ボタンをクリック</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000006.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000006.png" title="WS000006" width="347" height="230" class="alignnone size-full wp-image-742" /></a></p>
<p>3. 「メモリー分析」にチェックを入れて、「オプションの編集」をクリック</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000007.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000007.png" title="WS000007" width="347" height="236" class="alignnone size-full wp-image-743" /></a></p>
<p>4. 「オブジェクト割り振り配分を追跡」にチェックを入れる。</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000008.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000008.png" title="WS000008" width="392" height="271" class="alignnone size-full wp-image-744" /></a></p>
<p>5. パースペクティブを切り替える</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000009.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000009.png" title="WS000009" width="332" height="64" class="alignnone size-full wp-image-745" /></a></p>
<p>6. プログラムが実行されるため、メモリの割り当てを目視する。</p>
<p><a href="http://www.kinusati.net/wp-content/uploads/2010/07/WS000011.png"><img src="http://www.kinusati.net/wp-content/uploads/2010/07/WS000011.png" title="WS000011" width="344" height="110" class="alignnone size-full wp-image-752" /></a></p>
<p>調査の結果、どうやらフレームワーク側で利用した領域に対してガーベジがなされていないことが発覚。よくよく調査してみたら<a href="http://www.kinusati.net/2010/07/11/struts-2%E3%81%A7%E3%81%AE%E3%83%A1%E3%83%A2%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%AF/">Struts2 2.1.8.1未満にはメモリリークが存在する</a>とのこと。これかなー。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2010/07/11/eclipse%e3%81%a7%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af%e8%aa%bf%e6%9f%bb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2010/07/11/eclipse%e3%81%a7%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af%e8%aa%bf%e6%9f%bb/" />
	</item>
		<item>
		<title>Struts 2でのメモリリーク</title>
		<link>http://www.kinusati.net/2010/07/11/struts-2%e3%81%a7%e3%81%ae%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af/</link>
		<comments>http://www.kinusati.net/2010/07/11/struts-2%e3%81%a7%e3%81%ae%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 03:49:55 +0000</pubDate>
		<dc:creator>kinusati</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kinusati.net/?p=730</guid>
		<description><![CDATA[Struts2(2.1.8)を利用してアプリを制作していたのだが、なぜかメモリリークがするので調査したところ、Struts 2.1.8.1未満はメモリリークの不具合があるとのこと。 Struts 2.1.8.1のリリース &#8230; <a href="http://www.kinusati.net/2010/07/11/struts-2%e3%81%a7%e3%81%ae%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Struts2(2.1.8)を利用してアプリを制作していたのだが、なぜかメモリリークがするので調査したところ、Struts 2.1.8.1未満はメモリリークの不具合があるとのこと。</p>
<p><a href="https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12314677&amp;styleName=Text&amp;projectId=12311041&amp;Create=Create">Struts 2.1.8.1のリリースノート</a></p>
<h4>Bug</h4>
<ul>
<li>[<a href="https://issues.apache.org/jira/browse/WW-2167">WW-2167</a>]  &#8211; Memory leak when app stopped</li>
<li>[<a href="https://issues.apache.org/jira/browse/WW-2759">WW-2759</a>]  &#8211; The Struts 2 Portlet Tutorial &#8220;mvn archetype:create  -DarchetypeGroupId=org.apache.struts  -DarchetypeArtifactId=struts2-archetype-portlet  -DarchetypeVersion=2.1.1-SNAPSHOT -DartifactId=bookmark-portlet &#8221; Can&#8217;t  use</li>
<li>[<a href="https://issues.apache.org/jira/browse/WW-3141">WW-3141</a>]  &#8211; Maven2 struts archtype error &#8212;  documentation in  http://struts.apache.org/2.x/docs/struts-2-blank-archetype.html</li>
<li>[<a href="https://issues.apache.org/jira/browse/WW-3191">WW-3191</a>]  &#8211; Per Action alias validation for wildcard mappings broken due to  WW-2996</li>
<li>[<a href="https://issues.apache.org/jira/browse/WW-3269">WW-3269</a>]  &#8211; Docs are incomplete and generated zip is incompatible with windows</li>
<li>[<a href="https://issues.apache.org/jira/browse/WW-3290">WW-3290</a>]  &#8211; Struts 2.1.8.1 omnibus ticket</li>
<li>[<a href="https://issues.apache.org/jira/browse/WW-3356">WW-3356</a>]  &#8211; Maven Archetypes support broken</li>
<li>[<a href="https://issues.apache.org/jira/browse/WW-3401">WW-3401</a>]  &#8211; S2 JSON Plugin handles json content and contentType encoding  differently</li>
</ul>
<h4>Improvement</h4>
<ul>
<li>[<a href="https://issues.apache.org/jira/browse/WW-3271">WW-3271</a>]  &#8211; Upgrade Strust 2 archetypes to use latest version &#8211; 2.1.8</li>
<li>[<a href="https://issues.apache.org/jira/browse/WW-3272">WW-3272</a>]  &#8211; Create new Maven archetype base on Convention</li>
</ul>
<h4>Task</h4>
<ul>
<li>[<a href="https://issues.apache.org/jira/browse/WW-1726">WW-1726</a>]  &#8211; Update and release the Struts 2 archetypes</li>
<li>[<a href="https://issues.apache.org/jira/browse/WW-3359">WW-3359</a>]  &#8211; Struts 2.1.8 Archetypes omnibus ticket</li>
</ul>
<p>早速2.1.8.1のjarに入れ替えたらリークせずにガーベジがスムーズに走るようになりました。フレームワークの不具合は勘弁してほしいです。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kinusati.net/2010/07/11/struts-2%e3%81%a7%e3%81%ae%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.kinusati.net/2010/07/11/struts-2%e3%81%a7%e3%81%ae%e3%83%a1%e3%83%a2%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%af/" />
	</item>
	</channel>
</rss>

