-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 TheMechE wrote:
> Ok all, here's a topic on performance. I'd appreciate your opinions. > > Relevant documents would be the mm-mysql-driver interface....code for > ResultSet, and Statement. > I have the following issues... One... when I ask for a query where I'm going > to get 1Million rows, what I see is that my JVMachine steadily increases > memory as I loop through the recordset. I performed tests, such that, I > have no other code in the loop other than rs.next(). And we see a steadily > increasing footprint, ultimately until the JVM takes over the machine, and > backs the server into a corner. My cursor type is forward only, and I'm > setting the FetchSize to 1000. So in THEORY, we should have a limited > footprint for the paging of the recordset... AND... as I move through the > recordset, it should letgo of the rows as I pass them, but the memory > examples show otherwise. Actually, the JDBC driver has to retrieve all of the rows before it can return control to the client. This is because of how the MySQL protocol works, and what is required by the JDBC spec. MySQL does not have cursors, so therefore 'forward only' and 'fetchSize' mean nothing to the JDBC driver. If you absolutely _need_ to return millions of rows (there are very few applications that really need to do this), then you need to use Connector/J 3.0 or newer. The README has instructions for creating "streaming" result sets. If you want more details about what the details of the problem are, it's been covered 10's of times in the mailing list. A good search to start with would be: http://marc.theaimsgroup.com/?l=mysql-java&w=2&r=1&s=memory&q=b -Mark - -- For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mark Matthews <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, SW Dev. Manager - J2EE/Windows /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA <___/ www.mysql.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+1i6UtvXNTca6JD8RAq6RAKCvLslD/t21o3OgicjwR9OWfUg4bACgmd08 4ZpIhXsFR+xberHKlgK9itI= =G4X+ -----END PGP SIGNATURE----- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]