Bug #1242 OutOfMemoryError triggered on ResultSet.updateBytes() with large byte[]
Submitted: 10 Sep 2003 10:09 Modified: 10 Sep 2003 10:15
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.08 OS:Windows (Win 2000)
Assigned to: CPU Architecture:Any

[10 Sep 2003 10:09] [ name withheld ]
Description:
When updating the result set, ResultSet.updateBytes("file",fileBlob)
throws an out of memory error when fileBlob is more the 5 megs.

How to repeat:
try to update a large blob using JDBC

Suggested fix:
updateBytes() should be workable up to the size limit on long blob
[10 Sep 2003 10:15] Mark Matthews
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem is not the result of a bug.
For a list of more appropriate places to ask for help using MySQL
products, please visit http://www.mysql.com/support/

Thank you for your interest in MySQL.

MySQL requires enough memory client-side to hold the entire BLOB in memory before sending it to the server.

The issue stems from the fact that Java VMs by default only have small heaps (sometimes as small as 16 megs for the entire process). You need to start your JVM with a larger heap, using the '-Xmx' command-line parameter, which takes values in bytes, or in megabytes when followed with an 'm', e.g. '-Xmx256m'.