This is a discussion on JDBC out of memory error within the MySQL Database forums, part of the Database Forums category; I'm using the standard JDBC driver (mysql-connector-java-5.0.4-bin.jar) and I'm getting out ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm using the standard JDBC driver (mysql-connector-java-5.0.4-bin.jar)
and I'm getting out of memory errors. I'm doing a large select on a 3 million row table. It was my understanding that if you added a few params when creating the Statement, the driver wouldn't try to load the whole thing in memory: queryStatement = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); queryStatement.setFetchSize(100); Doesn't seem to work. I'd rather not have to rewrite the app to grab rows in small chunks. This is a single-user, batch processing app, so locking is not an issue. What am I doing wrong? |
|
|||
|
Chris wrote:
> I'm using the standard JDBC driver (mysql-connector-java-5.0.4-bin.jar) > and I'm getting out of memory errors. > > I'm doing a large select on a 3 million row table. It was my > understanding that if you added a few params when creating the > Statement, the driver wouldn't try to load the whole thing in memory: > > queryStatement = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, > ResultSet.CONCUR_READ_ONLY); > queryStatement.setFetchSize(100); > > Doesn't seem to work. > > I'd rather not have to rewrite the app to grab rows in small chunks. > This is a single-user, batch processing app, so locking is not an issue. > > What am I doing wrong? How do you call your java program? Do you supply any memory settings to the VM? By default the VM is running with 64 MB of memory which may be less than needed. Uwe |