PHP memory_limit

DoM

Well-Known Member
#1
Hi,
on php.ini memory_limit is 64MB

on litespeed i leave default directives about ram usage.

One customer complain about this:

Fatal error: Out of memory (allocated 18350080) (tried to allocate 30720 bytes) in /home/xxxxx/public_html/administrator/modules/mod_menu/helper.php on line 279

No where inside .htaccess in his home dir there were limit about or any custom php.ini present.

If i switch to Apache everything works.


Waiting for your reply

Regards
 

DoM

Well-Known Member
#3
Hi,
i do not understand where to check this value inside lite speed admin panel.

Can you please point me to right directive ?


Waiting for your reply

Regards
 

DoM

Well-Known Member
#5
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 71680
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) 524288
open files (-n) 6000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 1240
virtual memory (kbytes, -v) 460800
file locks (-x) unlimited

Waiting for your reply

Regards
 

NiteWave

Administrator
#6
the output shows max memory can be 460M > 64M

can the customer's issue be reproduced ? is the test script under the customer's document root ?
 

webizen

Well-Known Member
#8
Basically the php code in question requested 18MB memory but system doesn't have that much available for it (~30KB short) at the time. If this doesn't always happen when the code runs, you may consider raising memory softlimit/hardlimit for External App in LSWS (console->server(or vhost)->Ext App) to work around it. Otherwise, it is better to have customer optimize their php code to avoid large memory allocation.

Fatal error: Out of memory (allocated 18350080) (tried to allocate 30720 bytes) in /home/xxxxx/public_html/administrator/modules/mod_menu/helper.php on line 279
 

DoM

Well-Known Member
#9
Hi,
but right now i have these settings about memory usage:

Memory Soft Limit (bytes) 450M
Memory Hard Limit (bytes) 500M

So i do not understand why 20MB is a limit ?

i understand that with those settings above process can use maximum 500MB and not maximum 20MB


Waiting for your reply

Regards
 

DoM

Well-Known Member
#12
Hi,
i know but 64MB > 20MB as php script reports.


So also if there is a limit of 64MB why script stop execute when reach 20MB ?


Waiting for your reply

Regards
 

mistwang

LiteSpeed Staff
#14
And the PHP script can modify the limit from PHP code, if it does not work after raising the limit, still only get around 18M, you need to look into possible memory limit configuration of the PHP application.
 
Top