linux - How else might a PHP CLI script determine its memory limit? -
i need run php cli script , give lot of memory (it's automatic documentation generator needs cover large code base). have powerful machine , have allocated 5gb php, both in php.ini
, in inline ini_set('memory_limit','5120m')
declaration in script file.
if add these lines top of script:
phpinfo(); exit();
... claims has memory limit of 5120m, specified.
but script still errors out, saying
fatal error: allowed memory size of 1073741824 bytes exhausted
... 1gb, not 5gb specified.
is there other place script might looking determine memory limit? running in fedora linux.
(yes, ultimate solution may rewrite script more efficient, didn't write in first place, before resort that, want throw resources @ , see if works.)
the heap limit property size_t, 32 bits on 32-bit machine. if in bytes, limit memory limit 4 gb. may try running on 64 bit machine, 64-bit php.
edit: confirmed, heap->limit size_t (unsigned int) , in bytes. memory_limit of -1 sets heap->limit 4gb, , not disable documentation implies. setting 5gb makes wrap around 1gb.
Comments
Post a Comment