私は自分のアプリでメモリリークを探していて、何らかの理由で列挙のインスタンスがヒープに保持されているという jhat を見つけました。
それをシミュレートするために、Tomcat にアプリをデプロイし、少し操作して停止し、Tomcat で (jconsole を介して) GC を実行しました。次に、ヒープダンプを取り、これを見つけました:
instance of x.mgbean.quote.Input$Tab@0xe0887c0 (16 bytes)
Class:
class x.mgbean.quote.Input$Tab
Instance data members:
name (L) : VEHICLE (24 bytes)
ordinal (I) : 0
References to this object:
java.util.HashMap$Entry@0xe15f7c0 (24 bytes) : field value
class x.mgbean.quote.Input$Tab (84 bytes) : static field VEHICLE
[Lx.mgbean.quote.Input$Tab;@0xe0887f0 (20 bytes) : Element 0 of [Lx.mgbean.quote.Input$Tab;@0xe0887f0
[Lx.mgbean.quote.Input$Tab;@0xe1541e8 (20 bytes) : Element 0 of [Lx.mgbean.quote.Input$Tab;@0xe1541e8
これがどのように起こるか考えていますか?