In MQTT, messages with QoS 1 or 2 must be delivered at least once (QoS 2 messages must be delivered exactly once). If the client is not connected, the broker must store the message until the client is ready to receive it.
The HiveMQ blog has an interesting point:
But what happens if a client does not come online for a long time? The constraint for storing messages is often the memory limit of the operating system. There is no standard way on what to do in this scenario. It totally depends on the use case. In HiveMQ we will provide a possibility to manipulate queued message and purge them.
Since this seems to be dependent on the broker, how does Mosquitto handle this situation? Does it just crash after running out of memory or are old messages finally purged?