Welcome Guest! Log in
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.


Symptom

When using Mysql with a large set of data an OutOfMemoryError error is raised.

 

Solution

By Default, the MySQL JDBC Driver retrieves all results in memory, which can be the cause of OOM issues when working with large sets of data.

See ResultSet paragraph at http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html  for further information.

The solution is to indicate to the driver to process the row one by one, like explained in the MySql documentation.

To do that, set the fetch_size to the minimal Integer value. It can be done dynamically with the following rhino expression :

%e(rhino){java.lang.Integer.MIN_VALUE}e(rhino)%

 

You have no rights to post comments

Knowledge Base

Suggest a new Article!