[eluser]WanWizard[/eluser]
One of the downsides of the current Active Record implementation is that the entire resultset is loaded into memory as soon as you call ->result() or ->result_array(). Not needed for database engines that allow seek operations in the resultset.
If you then start looping over the result, and copying information, more memory is needed.
Having said that, PHP doesn't have a sizeof() function that tells you the size of a variable. You could use memory_get_usage() at the beginning and end of one loop, and calculate the difference to get an estimate of the memory used by that loop.