The maximum amount of information that can be stored in a space is proportional not to the volume of space but to the surface area surrounding that volume.
This is discovered by the study of the mathematics of black holes and known as the holographic principle, which is proving to be a powerful tool in theoretical physics.
When we store more and more information into a volume of space, we increase its energy. Since energy can be seen as being equivalent to mass, storing information means strengthening its gravitational field. And to a point, the volume of space will collapse into a black hole.
The holographic principle states that the universe is a hologram and the volume itself is illusory. The hologram is isomorphic to the information inscribed on the surface of its boundary. Therefore, when the volume of space collapses into a black hole by increasing the information stored, all the information will be encoded on the black hole's event horizon.