TMP_TextInfo.Resize() OutOfMemoryException

Anything I can do to prevent this? A buffer somewhere I can increase? Language used was simplified Chinese, platform windows pc.

STACK:
System.Array.Resize[T] (T[]& array, System.Int32 newSize) (at <834b2ded5dad441e8c7a4287897d63c7>:0)
TMPro.TMP_TextInfo.Resize[T] (T[]& array, System.Int32 size, System.Boolean isBlockAllocated) (at <affba3ad1dcd49ff819dae4d5ac0c85e>:0)
TMPro.TextMeshProUGUI.SetArraySizes (TMPro.TMP_Text+UnicodeChar[] unicodeChars) (at <affba3ad1dcd49ff819dae4d5ac0c85e>:0)
TMPro.TMP_Text.ParseInputText () (at <affba3ad1dcd49ff819dae4d5ac0c85e>:0)
TMPro.TextMeshProUGUI.OnPreRenderCanvas () (at <affba3ad1dcd49ff819dae4d5ac0c85e>:0)
TMPro.TextMeshProUGUI.Rebuild (UnityEngine.UI.CanvasUpdate update) (at <affba3ad1dcd49ff819dae4d5ac0c85e>:0)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at <5affe04924dd4e7b92d6e6025197937c>:0)
UnityEngine.UI.ScrollRect:LateUpdate()

is this a big text that’s never visibly in its entirety? like a 50 page text where only 2 pages are visible at any given time?
if yes, there are several optimizations you could engage in. only assigning the visible text at the current position is one, but it’s not easy.

OutOfMemoryException sounds like some bad allocations inside TMPro as text is rarely a reason to fill GBs of memory, even for logograms, but my above suggestion should help a little. you still have to put in the work and code it, but hopefully this is better than nothing

you could also try a newer TMPro version in an empty project, to check if they’ve fixed it

I don’t have any large amounts of text so I don’t think that’s the issue. Sadly I can’t reproduce the issue as was on build in the wild.