# Issue with array paging in LearningAgentsRecorder

**URL:** <https://forums.unrealengine.com/t/issue-with-array-paging-in-learningagentsrecorder/2705758>\
**Category:** AI\
**Tags:** unreal-engine, Learning-Agents, bug-report\
**Created:** [March 12, 2026, 7:00pm UTC](https://forums.unrealengine.com/t/issue-with-array-paging-in-learningagentsrecorder/2705758 "2026-03-12T19:00:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_YAF\_Lightbringer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_YAF\_Lightbringer](https://forums.unrealengine.com/u/_YAF_Lightbringer)\
**Post date:** [March 12, 2026, 7:00pm UTC](https://forums.unrealengine.com/t/issue-with-array-paging-in-learningagentsrecorder/2705758/1 "2026-03-12T19:00:37Z")

</div>

There’s an issue in LearningAgentsRecorder.cpp:67 (UE 5.7.4 EOS, but I don’t think that file has changed much). The condition:

```auto
	if (StepNum / ChunkSize <= Observations.Num())

```

is flipped and always true. Instead of allocating a chunk per 1024 state/action pairs, it allocates a chunk for **every** state action pair (even if the indexing functions don’t use that). Flipping it to

```auto
	if (StepNum / ChunkSize >= Observations.Num())

```

makes this work as intended. We found out because our schema contains a convolution of a few kilobyte, hence every chunk became 13 Megabytes. Combine that with roughly 50.000 recorded observations, and the runtime becomes very unhappy.

---

<div class="post-metadata">

**Author:** ![Deathcalibur](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deathcalibur/32/1037610_2.png) [@Deathcalibur](https://forums.unrealengine.com/u/Deathcalibur)\
**Post date:** [March 23, 2026, 8:55pm UTC](https://forums.unrealengine.com/t/issue-with-array-paging-in-learningagentsrecorder/2705758/2 "2026-03-23T20:55:20Z")

</div>

I just found this about a month ago and its fixed in Main / 5.8. I have no idea how this bug went unnoticed for about 2 years lol.

Thanks!
