#17507 closed enhancement (duplicate)
Hardcoded memory limit
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Performance | Version: | 3.2 |
| Severity: | normal | Keywords: | has-patch |
| 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)
Change History (6)
christianbolstad — 2 years ago
comment:2
in reply to:
↑ 1
christianbolstad — 2 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.
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed

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.