HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
The member Variable List: entries inside: com.hivemq.client.internal.mqtt.MqttBlockingClient.MqttPublishes increases in size with each call to receive(long, Duration)
The entries list seems to only get cleared, when a message to a subscribed topic is received. This can cause memory problems, when no message is received for a long time.
🔬 How To Reproduce
Steps to reproduce the behavior:
Subscribe to a Topic that does not receive any messages
Call receive(long, Duration) in a loop with a small duration. (Im using a larger duration in my application, but choose a small one here to reproduce the problem quicker)
Code sample
var blockingClient = Mqtt5Client.builder()
.identifier("blocking-subscriber")
.serverHost("localhost")
.serverPort(1883)
.automaticReconnectWithDefaultConfig()
.buildBlocking();
try (final Mqtt5BlockingClient.Mqtt5Publishes publishes = blockingClient.publishes(MqttGlobalPublishFilter.ALL)) {
blockingClient.connect();
blockingClient.subscribeWith().topicFilter("example/topic").send();
while (true) {
var publish = publishes.receive(1, TimeUnit.MICROSECONDS);
}
}
Environment
What version of this client are you using?
1.3.3
JVM version?
21
Operating System?
Windows 10
Which MQTT protocol version is being used?
5
Which MQTT broker (name and version)?
mosquitto 2.0.15
Screenshots
📈 Expected behavior
The entries list should probably be periodically cleared, even when no messages are received.
🐛 Bug Report
The member Variable List:
entries
inside:com.hivemq.client.internal.mqtt.MqttBlockingClient.MqttPublishes
increases in size with each call toreceive(long, Duration)
Theentries
list seems to only get cleared, when a message to a subscribed topic is received. This can cause memory problems, when no message is received for a long time.🔬 How To Reproduce
Steps to reproduce the behavior:
receive(long, Duration)
in a loop with a small duration. (Im using a larger duration in my application, but choose a small one here to reproduce the problem quicker)Code sample
Environment
What version of this client are you using?
1.3.3
JVM version?
21
Operating System?
Windows 10
Which MQTT protocol version is being used?
5
Which MQTT broker (name and version)?
mosquitto 2.0.15
Screenshots
📈 Expected behavior
The
entries
list should probably be periodically cleared, even when no messages are received.