Eclipse is giving Out of memory exception on my UNIX machine ,Having jdk 1.6.while trying to run my web application multiple times without terminating my local application server .
Then increased my heap space through vm arguments and also tried with changing Eclipse.ini.
But no use .
googled for sometime
and came to know that it is problem with the webapp classLoader multiple deployments .I am unable to find a solution for this problem .please give a solution to overcome this .
I found to use FileCleaner (FileCleaningTracker) for to avoid multiple deployment and written code in LogoutServlet.
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
req.getSession().invalidate();
FileCleaner.getInstance().exitWhenFinished();
resp.sendRedirect("/index");
}
But it is not working.
Thanks in advance .
I don’t know FileCleaner very well, but a cursory review of the javadoc states that calling exitWhenFinished() kills the background thread that deletes the files. My reading of this is that the files would then NOT be deleted.
My guess is that your problem is really a standard problem with hot-swapping code: Out of PermGen space. This occurs because there are parts of class definitions that are never deleted, and when you stop/start the servlet, those parts accumulate in the JVM.
The simplest answer to this problem is to create a large enough PermGen space to allow you to get work done. Try adding this to the VM args for the application server.
This should allow you to work longer before running out of memory. This number can be increased depending on the amount of memory on your machine.