Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#22699 closed defect (bug) (fixed)

Imagick: PHP memory_limit not increased to WP_MAX_MEMORY_LIMIT before load

Reported by: kirasong's profile kirasong Owned by: ryan's profile ryan
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch commit
Focuses: Cc:

Description

Currently, the PHP memory_limit is not automatically increased to WP_MAX_MEMORY_LIMIT in Imagick, as it is in GD.

This was initially done because Imagick uses significantly less RAM.
From a basic test, an initial upload does clock at a lot less PHP memory used for a general iPhone 4 JPG upload (34mb peak used vs. 78mb peak).

But, some users with with 32mb limits may have issues with Imagick, where they wouldn't have previously with GD.

http://core.trac.wordpress.org/browser/trunk/wp-includes/class-wp-image-editor-gd.php#L89
http://core.trac.wordpress.org/browser/trunk/wp-includes/class-wp-image-editor-imagick.php#L119

Attachments (1)

22699.diff (752 bytes) - added by kirasong 12 years ago.

Download all attachments as: .zip

Change History (5)

@kirasong
12 years ago

#1 follow-up: @nacin
12 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.5

Rotating a huge image is probably still a major drain.

#2 in reply to: ↑ 1 @markoheijnen
12 years ago

Replying to nacin:

Rotating a huge image is probably still a major drain.

Why? all the imagick handeling isn't in PHP but on a separate process. So the memory usage will not be that different.

#3 @ryan
12 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In 22997:

Increase the PHP memory_limit to WP_MAX_MEMORY_LIMIT in WP_Image_Editor_Imagick.

Props DH-Shredder
fixes #22699

#4 @kirasong
12 years ago

It does look like even with rotation we're still talking about < 40mb, but generally > 32.

This is something we probably don't need, due to Imagick doing processing in a module, but doesn't hurt, and is indeed a differing behaviour to what GD is doing.

Note: See TracTickets for help on using tickets.