Quick answer: Construct 3 Array used as a sparse map (using object IDs as indexes) ballooning memory? Array stores all indices densely - use Dictionary instead.

200-enemy game uses Array indexed by enemy IID. Array size grows to 50,000+ after several minutes.

Use Dictionary

Sparse keys. Memory proportional to entry count; not max index.

Or compact regularly

Periodically rebuild Array compactly. Trade CPU cost for memory.

Audit data structures

Each Array's index domain. Sparse domains belong in Dictionary.

“Arrays are dense. Dense storage scales with max-index.”

If your data is keyed by entity ID, Dictionary is the right structure. Array is for ordered collections.

Related reading