Solved

How can I solve this problem with my allocated memory?

Posted on 2014-09-25
4
145 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
  • 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 108

Expert Comment

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Php pie charts 3 26
Load google maps api into wordpress 5 33
Whether to store ID's or text values for detailed information 3 18
What is the best PDF generator to use? 1 21
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

948 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now