Java Heap Space Exception, with big ammount of data, any solution?

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

This is not a problem below 65.000 records, now from there... The aplication is throwing java heap exception, the memory consumption is raising over 600m and the CPU usage over 50% until the exeption.

As far as i know the rset.next() don't get all data (over 50 colums x +65000 row), but some records x time i've try to set fetch size too, nothing happened

rset.setFetchSize(1000);

i've erase my code and show a output, same error

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

please don't give me the answer of using -xm(s, x)512, 1024, etc... this could solved, not in my particulary case (i've tryied to set this even higher xD, nothing happend, i got the same exception at 65.000 records too)

Is there any other options i could try??, meaby changing some driver configurations or string conections ?? please help

sorry aboubt 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);

Answers


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


Need Your Help

How can I change code within a commit to help find a bug?

git merge commit bisect

I am trying to track down a specific bug in my code, but the trouble is the bug appeared somewhere in a block of commits where the only way to check if the commit breaks is commented out, so I can'...

how to send signal with more information to other threads?

c multithreading pthreads signals multiprocessing

I am programming with pthread in C language. I want a thread to tell other threads that it has put a message on the message queue, so that other threads would know that they can fetch messages from...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.