WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#17507 closed enhancement (duplicate)

Hardcoded memory limit

Reported by: christianbolstad Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2
Component: Performance Keywords: has-patch
Focuses: Cc:

Description

In several places the maxium memory limit is hard coded to 256M instead of using the WP_MEMORY_LIMIT constant introduced in WP 2.5.

For the admin side, where there can be legit need for even more memory It is possible to override this setting at one place in the code with a filter. The same possibilty should exist for all similar calls.

Fix/Patch:

I have changed the hard coded value to the constant WP_MEMORY_LIMIT for the user side memory setting and have applied the existing filter ('admin_memory_limit') to all on the wp-admin end.

Attachments (1)

memory_settins.patch (2.2 KB) - added by christianbolstad 4 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 follow-up: @kawauso4 years ago

wp_load_image() has a high memory limit because the GD is a memory hog and wouldn't necessarily work within the normal limit.

Don't really see what the use case for the filter would be either unless PHP fails to set the limit at all if it's beyond the maximum allowed by server settings.

comment:2 in reply to: ↑ 1 @christianbolstad4 years ago

Replying to kawauso:

wp_load_image() has a high memory limit because the GD is a memory hog and wouldn't necessarily work within the normal limit.

Don't really see what the use case for the filter would be either unless PHP fails to set the limit at all if it's beyond the maximum allowed by server settings.

The problem is that each @ini_set() call can (depending on the system configuration) override the server settings (if AllowOveride is enabled in for example Apache). People like me, that need more 256MB memory in some cases, have to edit the core file to get more memory. Not very optimal.

comment:3 follow-up: @greuben4 years ago

Duplicate of #15966

comment:4 @dd324 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

comment:5 in reply to: ↑ 3 @christianbolstad4 years ago

Replying to greuben:

Duplicate of #15966

Good catch, don't know how I managed to miss it when I searched.

Note: See TracTickets for help on using tickets.