Welcome Guest, Not a member yet? Register   Sign In
Active record class eating all the memory
#1

[eluser]ixxalnxxi[/eluser]
I am continually getting the following error:

Fatal error: Out of memory (allocated 47448064) (tried to allocate 50 bytes)

How is it allocating 47448064 when trying to allocate 50 bytes? When I comment out the active records portion of the code the error no longer comes up. Any idea as to what is going on or how to fix it?
#2

[eluser]Bogdan Tanase[/eluser]
Are you retrieving a large amount of data? Try LIMIT-ing your result...
#3

[eluser]ixxalnxxi[/eluser]
The query pulls, of 15,000 records, one piece of data out. I don't have it limited but I will test that. The reason I think it pulls one out is because it looks for where an id is matched, and the id is unique auto-incrementing so it should be by default only pulling one out.
#4

[eluser]Michael Wales[/eluser]
Is the ID column indexed / primary key?
#5

[eluser]ixxalnxxi[/eluser]
Quote:Is the ID column indexed / primary key?

that's correct.
#6

[eluser]Bogdan Tanase[/eluser]
After the last active record instruction, insert

Code:
echo $this->db->last_query();

And paste here the generated query
#7

[eluser]ixxalnxxi[/eluser]
!!

using 'echo $this->db->last_query(); ', i realized the query was actually

SELECT * FROM (`phpbb_users`) WHERE `username` = 0

resulting in about 11k worth of records (hence, the problem)

Thanks for the tip Tanase and for the help everyone else ~
#8

[eluser]chandrajatnika[/eluser]
why you don't use paggination??
#9

[eluser]ixxalnxxi[/eluser]
Pagination isn't necessary, I was only intending to pull out one record but was accidentally pulling out a lot more than I wanted.
#10

[eluser]Unknown[/eluser]
[quote author="chandrajatnika" date="1231778996"]why you don't use paggination??[/quote]

sorry. i'm beginner Wink
how i use paggination? how i save variables for paggination?

thx




Theme © iAndrew 2016 - Forum software by © MyBB