?
Solved

out of memory

Posted on 2006-04-25
8
Medium Priority
?
608 Views
Last Modified: 2008-02-01
Hi!
I´m trying to take some information from a sap table and then saving it into a sql table.
I use Jco Java connector to do this..

public void makeIn(String ubicacionTecnica) {
         
Client mConnection = this.getManualConnection();
Repository mRepository = this.getRepository(mConnection);
mConnection.connect();
ObjetoDAO dao = new ObjetoDAO();
         
JCO.Function function = null;
JCO.Table codes = null;
try {
               
     dao.eliminarInformeMTO();
     function = this.createFunction("ZPMF_DATOSPM", mRepository);
     if (function == null) {
         System.out.println("ZPMF_DATOSPM" + " not found in SAP.");
         System.exit(1);
     }
     
                JCO.ParameterList input = function.getImportParameterList();
                input.setValue(ubicacionTecnica,"UBIC_TEC");
     mConnection.execute(function);        
   
                codes = function.getTableParameterList().getTable("T_DATOSPM");
                for (int i = 0; i < codes.getNumRows(); i++) {
                      codes.setRow(i);
                      EQUNR = codes.getString("EQUNR");
           
                 String sql="insert into INFORME_MTO values('"+ EQUNR +"'')";      
     dao.ingresarDatos(sql);
}

When the code is running I get an error when I try to do the for becouse the original table has aprox 128.000 data and the error is out of memory.

Someone know what I have to do?

Thanks
0
Comment
Question by:olgavillamizar
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 2

Expert Comment

by:gauravkrtomar
ID: 16535857
u can either increase the nmemory size or u can alternatively have preparedstatements for the insert statement.
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 1500 total points
ID: 16536736
Use the -Xmx option to increase the heap-size in Java.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Author Comment

by:olgavillamizar
ID: 16537209
I Use java -XX:+AggressiveHeap  but I have the same problem
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16570903
try -Xmx option by specifying the Heap size suitably my trail & error method.

Thank You.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16571972
That's what I suggested: >> Use the -Xmx option to increase the heap-size in Java.

Did you try it?
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16572470
mayankeagle i am sorry i didn't see your comment.

:-)
0
 
LVL 1

Author Comment

by:olgavillamizar
ID: 16586327
I use it but doesnt work
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month13 days, 20 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question