Jump to content

storage limits of php


dadamssg87

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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.