Link to home
Start Free TrialLog in
Avatar of olgavillamizar
olgavillamizar

asked on

out of memory

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
Avatar of gauravkrtomar
gauravkrtomar

u can either increase the nmemory size or u can alternatively have preparedstatements for the insert statement.
ASKER CERTIFIED SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of olgavillamizar

ASKER

I Use java -XX:+AggressiveHeap  but I have the same problem
try -Xmx option by specifying the Heap size suitably my trail & error method.

Thank You.
That's what I suggested: >> Use the -Xmx option to increase the heap-size in Java.

Did you try it?
mayankeagle i am sorry i didn't see your comment.

:-)
I use it but doesnt work