The max_instance resource-limit limits the maximum number of instances a DDSDataReader can manage. Instance state is one of the most expensive resources to maintain as well as often being the highest one.
The resources allocated by an instance is normally only released when an instance is disposed and all known owners have unregistered the instance, please refer to FooDataWriter::unregister_instance and FooDataWriter::dispose.