I am making an web application in which i m sending ajax requests to my api methods in every 2 seconds for getting updates.
i am using a no. of maps and lists to retrive data.and i am using tomcat web sever.what the main problem is that i m facing heap size problem in some hours
after starting my application.
Actually my methods returns maps and lists and Garbage Collector is not able to remove them from memory rapidly.
please give me solution if anyone had worked on such type of application.....i am waiting for a right solution.........
Ideally, you shouldn't post this here, may be, moving this question to Tomcat, or Performance related section will help to get good reply..
Now, I think form what you wrote is "heap size problem" as "OutOfMemoryExcption" after some request to server, If that's what you mean, then firstly check out whether you left opened some precious resources like db connection , file stream, etc, then close them properly, and increase the memory allocated to tomcat (There is an option for this, refer tomcat docs).
thanks for giving solution..
but i have checked all the possibilities that you have told me in forum.
I am using Singleton Pattern in My D.A.O (managers).
i have given 64 megabyte memory to tomcat.
should i have to give more memory.
and don't you think so that we are trying to prevent from the problem instead of doing right solution by doing this.