[SOLVED] "java.lang.OutOfMemoryError: Direct buffer memory" when creating a lot of Box instances

If you are not set on rolling your own framework, you can use Blocks. You can checkout the page on the store or take a loot at the topic on the forum.
It will take care of the chunk management and mesh generation for you.

If not, you should rethink the way you are solving the issue. As paul said, a block world is not made of boxes. It’s made of different meshes that look like a lot of boxes stacked on top of each other.