NC Box memory exhausted

Yes, check it out if it works for you and how you balance the memory best between php, webserver, and database. Not sure if they have optimized it yet since it is the default setting.

Hello, I have the same issue but I have no idea how to increase the memory limit, since this is a snap version and the ‘php.ini’ is not editable for me. any ideas?

same memory problem. I think that the solution is in file /snap/nextcloud/current/config/php/php.ini
the following lines :
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M

but it is not possible to edit this file, even with sudo …

1 Like

There’s not enough control over the variables in the snap. They’ve properly locked it down to accomodate the most tech-averse users :frowning:

same problem here. Memory gets exhausted and the gallery can’t create the thumbnails. In the past I managed to change php.ini but now the value is somehow back to 128M and can’t be edited, even with SUDO. Trying to change ownerwship of the php.ini file results in "chown: changing ownership of ‘php.ini’: Read-only file system"
Anybody solved this issue?

No - limitations of the snap I guess. @oparoz

strange thing is that I remember changing the value and it worked for a while. Now that the limit is back to 128M I don’t trust my memory anymore. Could I have set it somewhere else?

So, yes, unfortunately, you can’t change PHP settings in this snap. The only solution is to fork the project for advanced users or wait until snapweb and the Nextcloud snap support config changes.

But I wouldn’t recommend raising the limit on a Pi, it would be asking for trouble :wink:

I just observed that it actually doesn’t seem to be depending on the size or dimension of the file (my photos all have the same dimension 5472x3648 but the size varies from 4-9 MB) - Currently it gets stuck on a 4 MB file while the thumbnail of the 9 MB file was created just fine.

Can I provide any other data (e.g. logs) that will help you to analyze the issue?

Or are are saying is that the gallery on my Nextcloud box will not work and I will not be able to make it work. Well, this would be a huge drawback for me and I guess for anyone using a similar or better camera.

This wouldn’t make me happy.

It’s not related to the weight, but to the dimensions of the image. If they’re all the same, it could be that something else is embedded or that the overall RAM is exhausted.

Are you on the latest snap?

And yes, I can understand your frustration, but image processing requires RAM and unfortunately, these small computers don’t have much.
Things will improves as ARM boards start to come with 4GB as standard, but that might take time.

I reckon we could double it without fear of explosions. My box is comfortably sitting around 250MB/920MB available.

same for mine, I also guess that doubling memory for PHP should be fine.

Here is why I think it won’t work by simply changing the limit…

4 PHP processes are running in parallel to generate thumbnails.
At 128MB each, you’re using 512M RAM, leaving some for Apache and MySQL
Now at 256MB, you’re using the full 1GB, which means that MySQL will crash.

So, same result, different reason :(.

The real solution is to make modifications to Gallery, making it possible to only generate 2 thumbnails in parallel via a configuration switch.

@oparoz are you the Gallery+ dev too? Would you be inclined to fork to a pi-friendly version alongside the current, or look to make modifications to mail source and leave it to users to enable & tweak that parallel setting?

Yes, I’m the maintainer, but I’m not doing much with it atm due to lack of resources.
I would be open to introduce such a setting because I just had to pick one value which might not be the best one for all hardware configs, so the plan was always to make it configurable.

I’ll accept PRs f you know someone who can help. I can give all the needed info.

1 Like

I’ll ask around.

Separately, any idea why there isn’t a download button in gallery view of each picture? Surely download is as important as delete (original gallery).

That button is missing from the slideshow in Files, not Gallery. I just assumed it was redundant at the time, before it was hidden under the 3-dots menu.
The plan is to re-enable it.

Files indeed sorry. Definitely not redundant.

At the moment I click into the pictures to find the one I want, note the filename, come out of the slideshow and download the pic. Look forward to seeing it return.

My questions/problems on this topic are answered.