PermGen space

Jetspeed でノートパッドポートレットを利用していて、そのエラーが起きるのだが、どうも、Sun の AMD 64bit Javaを利用すると発生する。32 bit だと問題ないのだけど・・・。ノートパッドポートレットは、Hibernate+Seasar2+MyFacesという構成だが、Hibernateまわりが怪しいのかな・・・。何が原因だろうか・・・。

参考情報

http://www.intra-mart.jp/download/doc/OutOfMemoryError.html

いろいろと調べてみる。状況を確認するには、-Dcom.sun.management.jmxremoteのjavaオプションを付けて実行して、jconsole でみるとわかりやすいかね。どうもみていると、Hibernate+Searsar2+MyFacesの構成のポートレットを読み込むと、PermGenが10Mくらいずつあがっていくような・・・。確かに、Hibernate関連で、無駄にjarファイルを登録しているからな・・・、絞らないとダメだな、これは。でも、ヒーブ関連もいっぱいになっているな・・・。JSF でコードを書くときにセッションも絞り込んだ方がいいのかも。うむむ、これを見ていると、反省すべき点がいろいろと見つかるな・・・。確か、以前、J2もjarファイルをウェブコンテナの方にまとめようという話もあったと思うし。そうしないと、たくさんポートレットを配備したりすると、PermGenとかあっさり超えるような。

JCPからの返事

返事をもらった。返事は、IBM の Stefan Hepper からだった。結局、彼はPlutoにも加わっているので、Plutoにも返事を出しているのでここで取り上げる必要はないが、一応、内容を書いておこう。

Subject: Re: JSR 168 Comments: PortletResponse#encodeURL(String) Problem
To: Shinsuke SUGAYA
Cc: jsr-168-comments@jcp.org
From: Stefan Hepper
Date: Fri, 10 Feb 2006 11:02:15 +0100
Hello Shinsuke,
this was considerate something that the servlet spec missed. If you
provide params that do not comply to specification in the javadocs you
should get an exc back and not accept the call and do nothing or respond
with an internal server error.
Note that the behavior in the sevlet case is undefined for such a string
and may as well result in an internall exc.
Regards,
Stefan

まとめると、ポータル仕様の方が正しいから、アプリケーション側でその辺は処理しろと言うことだね。ということは、MyFacesをなおしてやらんといかんということか。