How to avoid PHP memory exhaustion?

Fatal error: valid memory size 33554432 bytes exhausted (tried to allocate 136753 bytes) in / home / alien / Desktop / 1 / scanner.php on line 166

this is line 166 of the PHP code:

 $text[$i] =  curl_multi_getcontent ($curl[$i]);

is there any way to get around this by omitting RAM or something like that, sorry I'm not a programmer

+3
source share
4 answers

It looks like your server is configured for 32 MB of memory allocated for PHP. Without knowing more about your application, this sounds like a reasonable amount, but there are applications that require more.

In your file, php.iniyou can increase the memory limit, for example:

memory_limit = 64M

, , , . , , .

+3

-, memory_limit. , .

, , php 8 16 , 32... - , ... , , .

, , , . , 32mb , , .

+1

, PHP-, php.ini. . memory_limit.

: . , , .

0

PHP free_ram(). :

  • , php. php.ini memory_limit
  • unset () and cross your fingers. PHP launches the garbage collector as it sees fit and is difficult to measure.
0
source

Source: https://habr.com/ru/post/1722491/


All Articles