Issue Bug Resolved

#111148Excessive memory usage when opening forms with selectTree fields

Matthias Vogel 10/19/26, 12:25 updated 11/13/26, 21:15

Description

Problem

Opening an edit form containing selectTree fields can exhaust PHP memory when the configured foreign table contains many records.

During initial form compilation, TcaSelectTreeItems loads every matching foreign record and retains its complete data under config.items[*]._row for each field. This happens even with selectTreeCompileItems=false, although the actual tree is subsequently loaded through AJAX. The initial request only needs to determine whether selectable items exist.

In the reported setup, six selectTree fields referencing pages with 135,226 non-deleted records exhausted a 4 GiB PHP memory limit:

bc. Allowed memory size of 4294967296 bytes exhausted

Steps to reproduce

  1. Populate a foreign table, such as pages, with a large number of records.
  2. Configure several selectTree fields referencing that table.
  3. Open the corresponding editing form.

Expected behavior

The initial emptiness check should use bounded loading and stop after finding the first valid item. Rejected candidates must not prevent later valid items from being considered.

Existing filters, permissions, workspace overlays and empty-field handling must remain intact. The complete tree should continue to be loaded through AJAX.

Regression

Introduced by commit 4c4ca796c60:

Hide FormEngine fields with no selectable items

Reviews 2

History 28

  1. Matthias Vogel commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-13T18:45:14+00:00" > 11/13/26, 18:45 </span>

    Applied in changeset commit:f8689bdef1d7ac67c193a67de536db874b0a2cc9.

  2. Gerrit Code Review pushed patch set 1 for 14.3 to change 97625 status Resolved Under Review <span data-processor="relativetime" data-value="2026-11-13T18:50:43+00:00" > 11/13/26, 18:50 </span>

  3. Matthias Vogel commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-11-13T21:15:11+00:00" > 11/13/26, 21:15 </span>

    Applied in changeset commit:c350bda69a4d9474675071c0953d8afb0b6597fa.