File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes OutOfMemory in Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "OutOfMemory in Servlet " Watch "OutOfMemory in Servlet " New topic
Author

OutOfMemory in Servlet

Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
hi folks, i have this outofmemory error problem.
my servlet works with the data stored in a file which updates and grows. when the file becomes bigger than 4M the servlet checking it throws the error.
i've found that this might happen because of the jvm memory problems and the right way to deal with it is to use %JAVA_HOME%\bin\java -Xms64m file.class ...
the question is how can i run this on the server, where i don't have any class file with main method. thank's in advance.


Asher Tarnopolski
SCJP,SCWCD
Praveen Kumar Jha
Greenhorn

Joined: Jul 27, 2002
Posts: 10
You need to look at the script which starts jvm for servlet engine. In that script you should pass -Xmx option with appropriate maximum heap size. you may want to set same heap size for -Xms as well.


Praveen Kumar<br />Sun Certified Programmer for Java 2 Platform
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
thank's praveen, any ideas in what file exactly do i have to put it (tomcat 4.0)?
Praveen Kumar Jha
Greenhorn

Joined: Jul 27, 2002
Posts: 10
probably it is ${TOMCAT_HOME}/bin/startup.sh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OutOfMemory in Servlet