Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Allowed memory size exhausted

I have some memory issues in my application.

The problem occurred when I added a second database to the party.

In the MY_Model class I load the 2 databases.
so each submodel can access the objects.

class MY_Model extends Model {

    protected static $_db1 = null;
    protected static $_db2 = null;

    function MY_Model()
        if (!self::$_db1)
            self::$_db1  = $this->load->database('db1', true);
        if (!self::$_db2)
            self::$_db2 = $this->load->database('db2', true);

is this a good practice and why does it absorbe so much memory?

Did you check your memory settings in php.ini?


Theme © iAndrew 2016 - Forum software by © MyBB