Large images cause out of memory errors

I have some pages that contain a number of large images. When these pages are accessed the images try to resize all at once which causes out of memory errors and the Wiki becomes un-responsive.

It is not possible for me to limit the upload size as there are scenarios where we need the images to be large with high definition.

Is it possible to cache the resized images on disk to reduce the load.

That’s actually where those are supposed to be cached already but it’s possible the code which deal with cache -> browser is not very well optimized. Don’t hesitate to create an issue on https://jira.xwiki.org/browse/XWIKI with details on how to reproduce.

I have discovered where my issue lies.

The resized images cache as they are uploaded. If I view all the attachments it resizes them all at once with a width of 48px which causes XWiki to get the out of memory errors.

Does anyone have any advise on how I might generate the thumbnails as the images are uploaded?