CodeIgniter Forums
Memory limit of 10240 KB exceeded for buffered query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: Memory limit of 10240 KB exceeded for buffered query (/showthread.php?tid=65606)



Memory limit of 10240 KB exceeded for buffered query - bobykurniawan - 06-30-2016

Good day, I'm trying to `running a queries` for my `searching` 

but i get this result `<p>Error Number: IMSSP/-59</p><p>Memory limit of 10240 KB exceeded for buffered query</p>`

Here it's my query 

   
Code:
SELECT * From transaksi a 
    left join Outlet b on a.Outlet = b.OutletCode
    left join area c on b.areacode = c.areacode where b.BrandCode like  '%AR-1%'
    and b.areacode like '%%' and b.OutletCode like '%%' and tanggal 
    between '2016-03-01' and '2016-07-31'


from my query above i get `16046 rows`. when i try to do some other search that only showing `10 rows`, that error not showing and everything is working fine.

Here it's my fullscript.

   
Code:
function show_it()
    {
    extract(populateform());
    if($date_search == "")
    {
    unset($date_search);
    }
    if(isset($date_search)){
    $explode = explode('-',$date_search);
    $start_date = inggris_date($explode[0]);
    $end_date = inggris_date($explode[1]);
    $result = $this->modelmodel->showdata("SELECT * From transaksi a 
    left join Outlet b on a.Outlet = b.OutletCode
    left join area c on b.areacode = c.areacode where b.BrandCode like  '%$tipenya%'
    and b.areacode like '%$area%' and b.OutletCode like '%$outlet%' and tanggal 
    between '$start_date' and '$end_date'
    ");
    }else{
    $result = $this->modelmodel->showdata("SELECT * From transaksi a 
    left join Outlet b on a.Outlet = b.OutletCode
    left join area c on b.areacode = c.areacode where b.BrandCode like '%$tipenya%'
    and b.areacode like '%$area%' and b.OutletCode like '%$outlet%' 
    ");
    }
    }

Any solution? sorry for my bad english. I'm using Sqlsrv


RE: Memory limit of 10240 KB exceeded for buffered query - PaulD - 06-30-2016

That is a big result set and hence you appear to be reaching your server memory limit.

You can try changing it with a php.ini file (check with your host though), ( Something like ini_set("memory_limit","24M"); )

Alternatively, unless you really need 16,000 rows try limiting the results to the amount you need, say 20 rows for display with some sort of pagination system for navigating deeper.

Paul.


RE: Memory limit of 10240 KB exceeded for buffered query - sv3tli0 - 07-01-2016

10MB memory is too small value for limit (in your case this is set either by your server configuration or inside your code).

I think that for any PHP server, a minimum of 128MB memory should be configured at the start.
In common cases this amount is enough for everything.


RE: Memory limit of 10240 KB exceeded for buffered query - InsiteFX - 07-01-2016

This could also be the MySQL ini setting.


RE: Memory limit of 10240 KB exceeded for buffered query - Narf - 07-01-2016

(07-01-2016, 04:19 AM)InsiteFX Wrote: This could also be the MySQL ini setting.

It's Microsoft SQL Server ... you're not paying attention at all, and not for the first time.


RE: Memory limit of 10240 KB exceeded for buffered query - InsiteFX - 07-01-2016

That's because I like to get you going pulling your strings LOL!

2 good books to read Narf Games People Play - first and second editions.