The 'out of memory error' means that the amount of memory used by your
application has exceeded the amount of memory allocated to your Java Virtual
machine.  You can easily see why by the calculation below:

1 vector x 50000 records per vector x 10000 bytes per record = 500MegaBytes
of data PER VECTOR!, never mind any amount of memory needed for your other
objects!

Unless your server has monstrous amounts of memory, you're going to have
some real problems with this can of design, in my opinion.  If you really do
have a server with unlimited memory, you can adjust the heap size of the jvm
with the -ms and -mx options, although I still think you need to re-think
this piece of the code and ask yourself why you need to store this much data
in one vector.



-----Original Message-----
From: Salian, Santosh (GXS, TCS) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 8:39 AM
To: [EMAIL PROTECTED]
Subject: Outof Memory Error


Hi ,

I am getting out of memory Error when trying to populate a vector with 50000
records ; each record of size 10000 bytes (approx.)

here is the snippet....

<------------------JSP Starts-------------------->
Vector v = new Vector();


v = getData(x,y,z)
<------------------JSP Ends--------------------->


<------------------Bean Ends--------------------->
Vector getData(x,y,z)
{
   Vector vret = new Vector();

  System.out.println("Before Call to DB");
-----------------------1
   vret = getDatafromDB(z);
------------------------2
  System.out.println("After Call to DB");
------------------------3


   return (vret);
}
<------------------Bean  Ends--------------------->


My observation is
i)    The println stmt. 1 is getting printed in stdout but not stmt. 3
ii)   Error is raised by Jrun when stmt. 2's assignment is executed.
iii)  getDatafromDB(z) also returns Vector perfectly.

Configuration :: JSP-Bean
                       Jrun 2.3.3 on Sun Solaris

Please let me know the solution for this.......
Do I need  to anything on JRUN config. ?

Thanks in advance,
Santosh Salian

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to