mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 03:35:33 +00:00
This takes advantage of two key behaviours of PHP: 1. Assigning a string does not copy the string 2. Changing an offset in a string causes the string to be copied. These two factors combined, along with the fact that blocklight and skylight arrays are usually all-zeros, allow us to produce a significant memory usage reduction of loaded chunks. A freshly generated PM world with 3,332 chunks loaded drops from 310MB to 200MB memory usage with these changes applied.