Opened 5 months ago
Last modified 2 months ago
#23251 new defect (bug)
WordPress tries to unnecessarily set the memory limit
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | General | Version: | 2.5 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description (last modified by SergeyBiryukov)
Fixed bug where WordPress tries to unnecessarily set the memory limit when a value like '2G' is used instead of '2048M'.
See bad code & good code over at Github, which is what you should be using for stuff like this; https://github.com/WordPress/WordPress/pull/26
Discovered by @willem_o and @PeterJaap
Attachments (1)
Change History (12)
comment:1
markoheijnen
— 5 months ago
comment:2
peterjaap
— 5 months ago
Why was that submitted 2 YEARS AGO and still hasn't been fixed, while the patch is already there?
comment:5
markoheijnen
— 5 months ago
I say related. If you read the comments you will noticed why it isn't done. Also saying stuff like migrate to Github without knowing anything about the current progress isn't really smart to do.
comment:6
SergeyBiryukov
— 5 months ago
- Version changed from trunk to 2.5
comment:7
peterjaap
— 5 months ago
I've read the comments, can't see why the initial issue still isn't solved. It seems the commenters go off-topic with talk about benchmarking and the -1 option while all they should do is fix the bug and go from there. And it's marked as fixed, but its far from fixed.
comment:8
nacin
— 5 months ago
- Milestone changed from Awaiting Review to 3.6
Maybe I missed it then (and now, as I just re-read the ticket), but it seems that #14889 was primarily hung up on WP_MEMORY_LIMIT possibly being specified in G, rather than PHP's memory_limit core ini directive. You can shout in all caps but it isn't very respectful.
I'm fine with a patch along these lines. It would be good to determine exactly what values of memory_limit we should listen to. For example, it accounts for case insensitivity, which seems like a good idea. We have wp_convert_hr_to_bytes() in wp-includes/media.php — should we be moving that to wp-includes/load.php, improve it directly, and adapt it here?
While we don't accept pull requests via Github, you can simply add .diff or .patch to many GitHub URLs to get valid patches. For example: https://github.com/WordPress/WordPress/pull/26.diff. We also have no plans to migrate to GitHub, but that doesn't mean you can't use it to contribute — http://scribu.net/wordpress/contributing-to-wordpress-using-github.html.
comment:9
SergeyBiryukov
— 5 months ago
- Description modified (diff)
- Summary changed from Fixed bug where Wordpress tries to unnecessarily set the memory limit to WordPress tries to unnecessarily set the memory limit
comment:10
SergeyBiryukov
— 4 months ago
- Keywords needs-patch added; has-patch removed
comment:11
faishal
— 2 months ago
- Keywords has-patch added; needs-patch removed
Please add a patch instead of a link to a pull request. Also related to this ticket is: #14889