Apache2 Out of memory: Killed process

While using the photo app on my nextcloud instance, it crashes and the ubuntu reports the error “out of memory: Killed process 2253 (apache2)”

This issue is easy to reproduce while using the photos app to browse images. Browsing pictures and letting the previews loads causes apache2 to crash. Restarting the process get’s it going again but it happens again if I repeat.

I have the php memory limit set to 2000M. Need direction to identify where the issue is coming from.

This may not be a PHP issue. Check the system log (typically /var/log/messages but may be called something different under Ubuntu). If you see the error reported as from the OOM killer, then this is a system-wide problem. Ideally increase the system memory, or if you can’t do that then increase the swap space.