I'm have Magento webshop, it run cron jobs to execute scheduled processes. One of them is product import. It's responsible for importing of products and assigning them to categories. According to sql state I can see this part was finished. After it tries to invalidate cache. For cache I'm trying to use memcache on tcp or redis on socket. For both options I have the same result.I use strace command to see what it's trying to do.
sudo strace -e trace=all -f -d -p 10319
It's output for last 2 hours is:
[wait(0x57f) = 10319]
pid 10319 stopped, [SIGTRAP]
brk(0x236ec000 [wait(0x57f) = 10319]
pid 10319 stopped, [SIGTRAP]
) = 0x236ec000
[wait(0x57f) = 10319]
pid 10319 stopped, [SIGTRAP]
brk(0x2372c000 [wait(0x57f) = 10319]
pid 10319 stopped, [SIGTRAP]
) = 0x2372c000
[wait(0x57f) = 10319]
pid 10319 stopped, [SIGTRAP]
brk(0x2376c000 [wait(0x57f) = 10319]
pid 10319 stopped, [SIGTRAP]
) = 0x2376c000
I know that brk is used to allocate memory.
What other output can mean? What can be the reason of such behavior? Any ideas?
The problem was at array_merge
function, there was cycle for 270000 entities and all of them were merged inside that cycle, that's why script was allocating such a big amount of memory. Instead of it I used associative array, which is much faster.