メモリ不足エラーをデバッグしようとしています。Jmap でヒープ ダンプを実行し、Eclipse Mat で結果を分析すると、次のように表示されます。
7,677 instances of "java.lang.Class", loaded by
"<system class loader>" occupy 48,094,720 (23.99%) bytes.
最大のインスタンス:
class blah.BlahService$$EnhancerByCGLIB$$4a0a7d43 @ 0x2aaab06d9668
- 2,067,096 (1.03%) bytes.
BlahService は @Service アノテーション付きのスプリング サービスです。すべてのサービス クラスは、春にはシングルトンです (Bean ごとに IOC ごとに 1 つ)。では、なぜこのクラスが最も疑わしいのでしょうか。
私も見る
One instance of "org.apache.jasper.servlet.JspServlet" loaded by
"org.apache.catalina.loader.StandardClassLoader @ 0x2aaac17bc260" occupies 42,724,168
(21.31%) bytes. The memory is accumulated in one instance of
"java.util.concurrent.ConcurrentHashMap$Segment[]" loaded by "<system class loader>".
これは何を意味するのでしょうか?