Welcome Guest, Not a member yet? Register   Sign In
DB inserts & Memory not cleared?
#2

[eluser]J3roen[/eluser]
Pure PHP example:

Code:
<?
class Test extends Controller {

    function Test()
    {
        parent::Controller();    

        $link = mysql_connect('localhost', 'username', 'passwd');
    }
    
    function index()
    {

        for($i = 0; $i < 200; $i++) {
            $query = "INSERT INTO `test` (`data`) VALUES ('" . file_get_contents("/tmp/test.jpg") . "')";
            $result = mysql_db_query("yourdatabase", $query);
            
            echo round(memory_get_usage() / 1024 / 1024, 2) . "  $i <br />";
            flush();
        }

    }
}
?&gt;

In this case the memory usage stays the same and does not grow.


Messages In This Thread
DB inserts & Memory not cleared? - by El Forum - 10-29-2008, 12:37 PM
DB inserts & Memory not cleared? - by El Forum - 10-29-2008, 01:19 PM
DB inserts & Memory not cleared? - by El Forum - 10-29-2008, 02:01 PM
DB inserts & Memory not cleared? - by El Forum - 11-05-2008, 08:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB