• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OutOfMemoryError: PermGen space - pl help

 
chelakkad ben
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
The servlet throws this error message..

2005-05-16 20:55:09 StandardWrapperValve[server_flt]: Servlet.service() for servlet server_flt threw exception
java.lang.OutOfMemoryError: PermGen space

how to rectify this prob ...what modification should i make in my servlet program to avoid this error?
thks
rgds
csb
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are usually two causes of this problem:
1) not enough memory
2) infinite loop, usually caused by JSP-A including JSP-B including JSP-A etc etc.

Dave
 
chelakkad ben
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello David
thank you for the reply.
Is there any way to get over it? Can you be a little more specific?
Thank you for the info.
In fact its an applet-servlet comm appl that i am running. The servlet creates the object and is send to the applet where it is displayed. The applet then creates an object and is sent back to servlet for updating the database. So its objects being sent back and forth.

Again if the object created at the applet is set to null ..ie.
sub s = new sub(id,add,zip) ;
.......
.........
s = null;
Is object s a candidate for garbage collection?
What i mean is, if i no longer want the object s , is there any way to completely(explicitly) remove it from the memory?

thanks
rgds
csb
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the user really need all that data in the applet, at once?
If not, I'd consider putting a LIMIT or ROWNUM clause in your query to cut down the number of rows sent to the applet. Let the user query again for the next block of rows as s/he needs them.

If you do really need to send all of that data at once, then you should try increasing the heap size in the JVM. Google on -Xms and -Xmx for more information.
If you're running Tomcat on windows and you've installed the "start menu" items, you can alter the memory settings by going to Start -> Programs -> Apache Tomcat -> Configure Tomcat -> click on the Java or Memory tab.
There are fields for the initial and maximum memory settings.

You'll then have to deal with streaming all of that data over the network and then your user will have to deal with all of that data within the JVM under which the applet is running. If it's blowing up the server's JVM it'll probably cause you headaches on the client's JVM as well.
 
chelakkad ben
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ben
Thanks so much for that info. The client will be downloading a vector containing around 300 records(objects)- worst case . I am using vector so that the client can scroll through the records (by cliking next or previous buttons).As most of the clients are using win98, so using CachedRowSet may not work, i think.Any better idea??
As you mentioned, records can be limited to about 10 each.
Shall also try increasing heap size in jvm.
Using Apache2.0.52 - mod_jk2 - Tomcat 5.0.28 on win2k.
Thanks
rgds
csb
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic