[Resolved] lsphp: failed to map segment from shared object: Cannot allocate memory

gboudreau

Well-Known Member
#24
From a .php script, run through LSWS:
Code:
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 11896
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 2048
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 100
virtual memory          (kbytes, -v) 102400
file locks                      (-x) unlimited
The same script, run through Apache:
Code:
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 11896
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
Could the problem come from "virtual memory (kbytes, -v) 102400" ?
 

gboudreau

Well-Known Member
#26
Got it!
I grep-ed for 100M in lsws/conf/* and found it in Default.xml (and some other virtualhosts config files).
I removed the virtualhost-specific external apps and PHP script handlers (not sure why I had them!) That fixed the issue!
Thanks for the help.
 
#27
loading less modules is part of troubleshooting process to see if there is anything else prevents lsws from using php.

assuming your /etc/php.ini is copied from the old server, can you check memory_limit in the phpinfo() output? is that the same in /etc/php.ini?

do you have any opcode cache setup? such as apc, xcache, eAccelerator, etc? if so, how much memory gets allocated for that?
From phpinfo: memory_limit 768M (same as php.ini)
Same php.ini file on both servers.

No opcode cache enabled.

I tried to remove the 'shared' from my configure command. It didn't help.
Now I'm trying the default configure line that LSWS suggests.
 
#28
Hello,
have the same issue with imagik php module
Warning: Could not load "/usr/lib/graphviz/libgvplugin_pango.so.5" - libpango-1.0.so.0: failed to map segment from shared object: Cannot allocate memory


Code:
 file ./lib/php/extensions/no-debug-non-zts-20090626/imagick.so
./lib/php/extensions/no-debug-non-zts-20090626/imagick.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), not stripped

Code:
# file lsphp-5.3.1
lsphp-5.3.1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped

and 64 bit system

Memory Soft/Hard Limit 250/300

mem limit in php.ini 64m

ulimit output from php script
max memory size (kbytes, -m) unlimited
virtual memory (kbytes, -v) 204800
 
Top