Jump to content

Recommended Posts

I'm worried i'm trying to fit too much data into php and have no idea how to check. I have a script that pulls data from 18 database tables and stores the rows in variables, then my script uses that information to determine what to put in a new array. The new array has arrays in arrays. A typical item in the array will have around 2500 characters. The array will most likely contain 1 to 30 items.

 

Is that too much?

 

How should i go about testing the limits?

 

Is there  a way in php to measure how much ram you're using in a particular script?

Link to comment
https://forums.phpfreaks.com/topic/246050-storage-limits-of-php/
Share on other sites

nice. didn't know those functions existed. So i'm running php 5.3.2 so have 128M(134,217,728 bytes) to use.

 

I just ran the memory_get_usage() function and it returned 926,312 and the memory_get_peak_usage() returned 969,108.

 

guess i'm looking fine thus far

While I wouldn't just update it willy nilly, you can increase the memory limit PHP imposes. You can either do it in your php.ini file (look for the "memory_limit" directive), which would mean all requests have that limit, or you can do it on a per-request basis using ini_set:

 

ini_set('memory_limit', 'xxM');

 

Edit

 

In-case you find yourself in that position, that is.

While I wouldn't just update it willy nilly, you can increase the memory limit PHP imposes. You can either do it in your php.ini file (look for the "memory_limit" directive), which would mean all requests have that limit, or you can do it on a per-request basis using ini_set:

 

ini_set('memory_limit', 'xxM');

 

Edit

 

In-case you find yourself in that position, that is.

yeah, you of course want to compile your code wherever you can to decrease the memory that you are using.. just be careful when manually setting the memory limit..

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.