Commit c670265
committed
Revert "Clean up host pointers in level 2 of clean-up flag (#21112)"
This reverts commit 8ed0c85.
The host tree is a cyclical structure. Leaking a single DOM node can
retain a large amount of memory. React-managed DOM nodes also point
back to a fiber tree.
Perf testing suggests that disconnecting these fields has a big memory
impact. That suggests leaks in non-React code but since it's hard to
completely eliminate those, it may still be worth the extra work to
clear these fields.
I'm moving this to level 2 to confirm whether this alone is responsible
for the memory savings, or if there are other fields that are retaining
large amounts of memory.
In our plan for removing the alternate model, DOM nodes would not be
connected to fibers, except at the root of the whole tree, which is
easy to disconnect on deletion. So in that world, we likely won't have
to do any additional work.1 parent 1bd41c6 commit c670265
File tree
2 files changed
+18
-24
lines changed- packages/react-reconciler/src
2 files changed
+18
-24
lines changedLines changed: 9 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1382 | 1382 | | |
1383 | 1383 | | |
1384 | 1384 | | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | 1385 | | |
1398 | 1386 | | |
1399 | 1387 | | |
| |||
1412 | 1400 | | |
1413 | 1401 | | |
1414 | 1402 | | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
1415 | 1412 | | |
1416 | 1413 | | |
1417 | 1414 | | |
| |||
Lines changed: 9 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1382 | 1382 | | |
1383 | 1383 | | |
1384 | 1384 | | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | 1385 | | |
1398 | 1386 | | |
1399 | 1387 | | |
| |||
1412 | 1400 | | |
1413 | 1401 | | |
1414 | 1402 | | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
1415 | 1412 | | |
1416 | 1413 | | |
1417 | 1414 | | |
| |||
0 commit comments