Java Heap Space Exception, with lots of data, any solution?

I have a big problem with heap java memory I'm trying to navigate from oracle 11g database to access 2007 file

This is not a problem below 65,000 entries, now from there ... A java heap exception is thrown in the application, memory consumption increases by more than 600 m, and CPU usage by 50% to exeption level.

As far as I know rset.next () does not receive all the data (more than 50 columns x +65000 rows), but some records x time I also try to set the sample size, nothing happened

rset.setFetchSize(1000);

I deleted my code and showed the output, the same error

while (rset.next()) {
 if (cont % 5000 == 0) {
     System.out.println(cont + " proccesed and counting ...");
 }
}

please don’t give me an answer for using -xm (s, x) 512, 1024, etc .... this could not be solved in my special case (I tried to set this even higher xD, nothing happened, I got the same exception in 65,000 entries)

Are there any other options that I could try? Does meaby change some driver configurations or line connectors? please, help

Sorry, I do not agree with my English.

this is my connection:

Class.forName("oracle.jdbc.driver.OracleDriver");
this.conn = DriverManager.getConnection("jdbc:oracle:thin:@" + getServer() + ":1521:orcl", getUser(), getPassword());
                this.stmt = this.conn.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_UPDATABLE);
+3
source share
1 answer

It seems like the problem is that you are using a Scrollable ResultSet and are going to use more memory.

+2
source

Source: https://habr.com/ru/post/1778390/


All Articles