To set JVM memory size for a web application

Thomsi
Thomsi used Ask the Experts™
on
Hi,
I have a problem pertaining to the memory size of JVM for my web application which is on Netscape Enterprise Server 3.5. When I try to retrieve a veruy large amount of data across all my tables, I am receiving "java.lang.OutOfMemoryError". In some some site I read that for stand alone applications we can set the maximum value to a higher value by the command :
java -mx128m MyApp

Can anybody have any solution for my problem as my web application is not working now.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
A web application will work similarly to a standalone in that you can specify the memory usage. The difference is where you specify it. In a web app you generally specify it in a config file. Im not familar with the Netscape product so check your documentation or maybe someone else is familar with it.

So may also want to specify fetch size for the ResultSet if your DB driver supports it. This will limit the amount of memory the driver uses in queries by only grabbing x records at a time.

Commented:
how are you starting your web application, through some script where it must say

java ....

just put the above jvm options after the java command.

We need to know how you start your web application in order to better assist you

vemul

Author

Commented:
Its a servlet based application. When we are trying to get a report across organization, it returns a huge amount of data. At that time the error occurs. I am using Oracle 8i database.
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Commented:
Do a search for setting max memory in your Netscape Enterprise documentation. I don't have a copy and don't have time at the moment to search online.

If you are not yet testing under load, allocating more memory to your sevlet engine may not be the only solution you will need.
- Are you holding all the data in memory in your webapp before passing it on? Can you pass it on a chunk at a time?
- Is it the driver that is using all the memory? Can you change the fetch size in queries to help memory consumption?
Thomsi:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points for conick

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venabili
EE Cleanup Volunteer

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points for conick

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venabili
EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial