> For the complete documentation index, see [llms.txt](https://apex-studio.gitbook.io/dash-core-endless-runner/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apex-studio.gitbook.io/dash-core-endless-runner/03_core_runtime/advanced-object-pooling-subsystem.md).

# Advanced Object Pooling Subsystem

### Chapter 2: Advanced Object Pooling Subsystem

Memory fragmentation and Garbage Collection (GC) spikes are the primary causes of frame drops in endless runners. Dash Core completely eliminates runtime instantiation through a highly governed, pre-allocated memory pooling architecture.

&#x20;

#### 2.1 TerrainPoolManager & Zero GC Execution

The TerrainPoolManager operates in tandem with the BiomeDirector to stream environment segments. To achieve true Zero GC during dictionary lookups, the architecture abandons standard string-based keys. Instead, it utilizes GetInstanceID() as the dictionary key (Dictionary\<int, Queue\<TerrainSegment>>). This allows the engine to fetch and recycle complex terrain chunks instantaneously with zero overhead.

&#x20;

#### 2.2 ItemPoolManager & Dynamic Elevation

Collectibles and power-ups are governed by the ItemPoolManager. Upon spawning, pickups subscribe to decoupled events (OnItemCollected). A standout feature of this system is the dynamic "Pop-in" elevation shift (ShiftItemsElevation); when flight-based gadgets like the Jetpack are activated, the pool manager dynamically shifts the active object trajectories into the sky, ensuring seamless vertical gameplay.

<figure><img src="https://1429375011-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQO6gSaZAImyfq8TThzBJ%2Fuploads%2F7fap7mXAIuGWQfFi94pe%2FPicture13.png?alt=media&amp;token=909c4980-176e-49f8-8b2d-7dd124a213ac" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apex-studio.gitbook.io/dash-core-endless-runner/03_core_runtime/advanced-object-pooling-subsystem.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
