Fixing memory consumption for octrees