I am new to codiginter .When i load it gives memory error with following message what should i do now
Allowed memory size of 134217728 bytes exhausted (tried to allocate 65488 bytes) in C:\xampp\htdocs\ci\system\database\DB_driver.php on line 1968
I am new to codiginter .When i load it gives memory error with following message what should i do now
Allowed memory size of 134217728 bytes exhausted (tried to allocate 65488 bytes) in C:\xampp\htdocs\ci\system\database\DB_driver.php on line 1968
You have created an infinite recursion scenario. Look:
Database_Model
and Session_Model
extend Model.$this->db
and $this->session
.Model
, so they will also instance
their own Database_Model
and Session_Model
.Solution:
The correct way is to edit your php.ini
file. Edit memory_limit
to your desire value.
As from your question, 128M
(which is the default limit
) has been
exceeded, so there is something seriously wrong with your code as it
should not take that much.
If you know why it takes that much and you want to allow it set
memory_limit
= 512M
or higher and you should be good.
However try to avoid huge memory use, if the number of users are going to be more.
Moreover, If you monitor your server, you will see that it is now probably using up most of the RAM and even swapping to disk.
You should probably try to track down the exact bug in your code and fix it.
Hope this is helpful