Solved

How can I solve this problem with my allocated memory?

Posted on 2014-09-25
4
158 Views
Last Modified: 2014-09-25
I'm exporting a table from a MySQL database. The code is good, but the table is 250,000 rows and my pipes are apparently getting clogged based on this error:

Allowed memory size of 36700160 bytes exhausted (tried to allocate 24 bytes) in C:\wamp\www\json\csv_test.php on line 19

I put this at the top of my page:

ini_set("memory_limit","35M");

But to no avail. I'm missing something....

What do you think?
0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 250 total points
ID: 40344815
Do you not have more memory than that?
Why not do batches of 50,000 and see if it goes through.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 40344824
What does the code say?  Please show us all of it, not just line 19.
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 40344828
You might also want to learn about phpinfo() so you can see what the true memory limit is before you set it to something arbitrary.  You can learn a lot from phpinfo()
http://php.net/manual/en/function.phpinfo.php
0
 

Author Comment

by:brucegust
ID: 40344830
Thank you, gentlemen! I figured it out and yes, Ray, I saw that too. Thanks!

BTW: Still not out of the woods. I'm a pig on roller skates, boys...

http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_28525834.html
0

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question