From: Warren Young Date: March 23 2011 9:08am Subject: Re: StoreQueryResults destructor runs without end... List-Archive: http://lists.mysql.com/plusplus/9265 Message-Id: <64C9DA60-CB21-4BD5-8D5F-716B2F49718D@etr-usa.com> MIME-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable On Mar 23, 2011, at 3:00 AM, Warren Young wrote: > On Mar 22, 2011, at 6:48 PM, Paul Dalach wrote: >=20 >> I am pulling ~80k objects with four fields. Does that constitute = huge? >=20 > Well, it depends on how big those fields are, doesn't it? If they are = four 32 byte strings, the amount of data in use is at least 10 GB. Sorry, got my MB confused with my GB there. 80,000 records x 4 x = 32-byte strings is ~10 MB, not 10 GB. Still, the answer may still be valid if the field sizes are large = enough. Keep in mind also the behavior of std::vector, which StoreQueryResult is = based on. (More or less, it is a 2D vector of mysqlpp::String.) It = doubles in size each time you exceed its size, so it can keep growing. = That means lots of RAM copies for such a large number of fields. You can solve some of that by calling res.reserve(N), where N is larger = than the number of records possible from the query, but you still have = to deal with the fact that you're trying to store all that in RAM at = once.=