• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MYSQL Result - Fatal Error

#1
[eluser]Unknown[/eluser]
Hi All,

My php memory_limit is set on 128mb. All im doing is retrieve 10,000 records and paginating them.

I get this message:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1572864 bytes) in /codeignitorproject/system/database/drivers/mysql/mysql_result.php on line 162

Any ideas? Line 162 is pointing to: mysql_fetch_object()

#2
[eluser]InsiteFX[/eluser]
I suggest that you read the CodeIgniter users guide on pagination.

Pagination

Enjoy
InsiteFX

#3
[eluser]danmontgomery[/eluser]
[quote author="InsiteFX" date="1268089097"]I suggest that you read the CodeIgniter users guide on pagination.

Pagination

Enjoy
InsiteFX[/quote]

A particularly unhelpful response, since he's obviously trying to paginate with javascript and the pagination section of the user guide makes no reference to memory usage...

67108864 bytes is 64mb, not 128mb... Which means your memory_limit is not being set correctly (or is being reset). If you want it at 128, I'd try setting it in the file:

Code:
ini_set('memory_limit','128M');

However, I don't think that will be enough... mysql_fetch_object() tried to allocate 1.5mb, so if you're getting 10000 records at 1.5mb per, you're going to need 15gb of memory... I'd rethink your pagination strategy.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.