Acquia Cloud Next Readiness Assessment - setMemory_limit

Created on 12 May 2022, about 2 years ago
Updated 19 July 2023, 11 months ago

Problem/Motivation

Acquia ran a readiness assessment on a site using XML sitemap, and it had a failure in the setMemoryLimit function.

The exact failure is "PHP memory overrides in code should not exceed 1G."
Their assessment fails XML sitemap because hardcoded memory limits were detected.

Code - return @ini_set('memory_limit', $new_limit);
Line Number - 256
File Location - /mnt/www/html/startheregetthere/docroot/../docroot/modules/contrib/xmlsitemap/src/XmlSitemapGenerator.php

Steps to reproduce

Proposed resolution

I need advice on how to proceed with the changes that should be made to avoid hardcoded memory limits in XML sitemap

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Postponed: needs info

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States JudyAkers

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ͺπŸ‡ΈSpain frouco

    The fact is that the Acquia Cloud Site Review report gives a warning if in the code appear a potential modification of the memory_limit value.

    @Dave Reid you are right is not a fixed value, but this will increase the memory_limit value if the module considers that it cant process the sitemap.

    With this choice, the module increases the memory_limit on its own and considers that generating the XML is more important than continuing to serve pages. Also, this memory increase does not ensure that will finish in seconds, simply in less time to the detriment of other processes. In the end, the server memory is limited and increasing the memory limit only reduces the number of PHP processes that can be executed simultaneously.

    Probably, the correct approach is to check if the current memory_limit value is enough to generate the XML sitemap and if not, launch a warning with the memory required/recommended in the report status, for example.

    Here is a path with the described approach

Production build 0.69.0 2024