permaculture playing cards*
The moose likes Java in General and the fly likes heap size problem with web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "heap size problem with web application" Watch "heap size problem with web application" New topic
Author

heap size problem with web application

nitin varshney
Greenhorn

Joined: Sep 17, 2008
Posts: 10

Hi All...,
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.........


thanks and regards

Nitin Varshney
Deepak Rajkiran
Greenhorn

Joined: Feb 10, 2008
Posts: 6
I am facing same problem nitin...
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1


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).


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
nitin varshney
Greenhorn

Joined: Sep 17, 2008
Posts: 10
hi ,
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.

please give me some more guidance

thanks and regards

Nitin Varshney

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1


Whats the exact error/exception you got ?
Also, post the logs stating the problem .
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41115
    
  45
If 64MB is the maximum memory, then that's too little. Try 256MB for starters.

Also, polling every 2 seconds sounds like a lot. Is the previous request even finished by the time the next request goes out? Can you change this to every 10 seconds or so?


Ping & DNS - my free Android networking tools app
 
 
subject: heap size problem with web application
 
Similar Threads
java heap size error
heap size problem with application
heap size problem with application
heap size problem with application
how will i get my values from collection?