Skip to content

Commit d7a2e4d

Browse files
ondrejmirtesclaude
andcommitted
Give the turbo run-leg on macOS enough memory for the memo's footprint
The TypeCombinatorCache memo adds ~7% to a worker's peak memory, and the per-worker footprint grows with the number of files a worker analyses. macOS runners have few cores, so their few workers each analyse enough files to tip make phpstan's default 450M limit that many-worker Linux runners stay under. Parametrize the limit and raise it to 1G for that leg only, keeping the 450M canary on Linux. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LVQhbBxDjDVAVeJVvLpWYE
1 parent fe8b0f3 commit d7a2e4d

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎.github/workflows/turbo-ext.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,10 @@ jobs:
226226
'
227227
228228
- name: "Run"
229+
# The memo's per-worker footprint grows with files-per-worker; macOS
230+
# runners have few cores, so each of their few workers analyses enough
231+
# files to tip the default 450M limit that a many-worker Linux runner
232+
# stays under.
233+
env:
234+
PHPSTAN_MEMORY_LIMIT: ${{ matrix.operating-system == 'macos-latest' && '1G' || '450M' }}
229235
run: ${{ matrix.script }}

‎Makefile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ cs: cs-install
159159
cs-fix: cs-install
160160
XDEBUG_MODE=off php build-cs/vendor/bin/phpcbf
161161

162+
PHPSTAN_MEMORY_LIMIT ?= 450M
163+
162164
phpstan:
163-
php bin/phpstan clear-result-cache -q && php -d memory_limit=450M bin/phpstan -v
165+
php bin/phpstan clear-result-cache -q && php -d memory_limit=$(PHPSTAN_MEMORY_LIMIT) bin/phpstan -v
164166

165167
phpstan-result-cache:
166168
php -d memory_limit=450M bin/phpstan

0 commit comments

Comments
 (0)