Skip to content

Increase Playground runtime PHP memory_limit to 512M - #3936

Merged
gcsecsey merged 5 commits into
trunkfrom
stu-1821-increase-playground-memory-limit
Jun 24, 2026
Merged

Increase Playground runtime PHP memory_limit to 512M#3936
gcsecsey merged 5 commits into
trunkfrom
stu-1821-increase-playground-memory-limit

Conversation

@gcsecsey

@gcsecsey gcsecsey commented Jun 23, 2026

Copy link
Copy Markdown
Member

Related issues

This PR addresses "Problem 2 (fatal errors / memory exhaustion)" from that report.

How AI was used in this PR

Used Claude Code to reproduce the wp-admin OOM locally, trace it to the Playground runtime's memory cap, and verify the fix against a heavy plugin stack.

Proposed Changes

The reported issue is that when a site with numerous plugins is cloned into Studio, and then run with the Playground runtime, the front-end loads but wp-admin dies with Fatal error: Allowed memory size of 268435456 bytes exhausted (256 MB).

The PHP-WASM HTTP server serves every request with a hard-coded PHP memory_limit of 256 MB. A realistic production plugin stack (WooCommerce, WooPayments, Jetpack, Jetpack Boost, Jetpack CRM, MailPoet, Site Kit, etc.) already peaks at ~224 MB on an empty database, so wp-admin tips over 256 MB when the site's plugins and data load.

This PR raises the Playground serving memory_limit to 512 MB, matching the native runtime, so the two behave consistently, and heavier sites can open wp-admin.

trunk this branch
CleanShot 2026-06-23 at 17 02 48@2x CleanShot 2026-06-23 at 16 59 14@2x

Testing Instructions

  • Visual review should be enough

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? (npm run typecheck passes; eslint clean on the changed file.)
@gcsecsey gcsecsey changed the title Increase Playground runtime PHP memory limit to 512M Jun 23, 2026
@gcsecsey
gcsecsey requested a review from a team June 23, 2026 16:03
@gcsecsey
gcsecsey marked this pull request as ready for review June 23, 2026 16:05

@gavande1 gavande1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Gergely. The code changes look good. I am curious: Do we really need to increase memory? 256 MB should be enough.

I am approving the PR to unblock you.

@gcsecsey

Copy link
Copy Markdown
Member Author

Thanks, Gergely. The code changes look good. I am curious: Do we really need to increase memory? 256 MB should be enough.

I am approving the PR to unblock you.

Thanks! Yes, I think the setup I used was pretty reasonable. A normal Woo site would also have this many plugins and might hit local memory limits. The original reporter also hit the memory limit when cloning their site to Studio. Also, just as a side note, raising the limit to 512M for Playground is matching the limit we already have in place for native PHP.

@gcsecsey
gcsecsey enabled auto-merge (squash) June 24, 2026 15:58
@gcsecsey
gcsecsey disabled auto-merge June 24, 2026 19:29
@gcsecsey
gcsecsey merged commit be37f29 into trunk Jun 24, 2026
10 checks passed
@gcsecsey
gcsecsey deleted the stu-1821-increase-playground-memory-limit branch June 24, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants