I have a code that I use from another command, and I spent several days trying to track down a suspicious memory leak in my application. I get an OutOfMemory error after a few redploys. I used several leak tracking tools, including MyKit Java Profiler and IBM Support Assisant Memory Analyzer. My application is a Spring 3.0.5 J2EE application running on WebSphere 6.1 using annotation-controlled spring-mvc controllers.
Most of the research I have done points to a class that I find very suspicious, we will call it MyFactory, and it looks like this:
import org.springframework.context.ApplicationContextAware; public final class MyFactory implements ApplicationContextAware {
There is a whole bunch of other logic in this class that I forgot, which basically reads data from the database and stores it in memory (near the cache). However, this class seems to hang with ApplicationContext after the application has been re-installed.
Is this class a class loader hanging on the ApplicationContext or does not allow to completely clear it? I know that we no longer need the getInstance method, and I donβt see the need for this class to have a static ApplicationContext - it seems to me that Spring should ensure the singletonity of this class.
source share