hivemq / hivemq-mqtt-client

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
https://hivemq.github.io/hivemq-mqtt-client/
Apache License 2.0
832 stars 153 forks source link

Consumption of internal memory "User data" #573

Closed acaliaro closed 4 months ago

acaliaro commented 1 year ago

🐛 Bug Report

We have a production Android application that uses the HiveMQ client for mqtt. We are noticing that on some devices, the "User Data" of the application has reached a size greater than 1.5 GB. I wanted to know if the MQTT client saves data on its DB and possibly if this data is cleaned, or if there is a way to clean them, thanks

Environment

Android 11,

Hardware or Device?

What version of this client are you using? com.hivemq:hivemq-mqtt-client:1.2.1

pglombardo commented 1 year ago

Hi @acaliaro - the client doesn't have any internal database or a file store (yet). For higher quality of service levels (QoS 1 + 2), it does keep a limited list of messages that are pending acknowledgement. If you setup manual acknowledgement but not actually acknowledging - that might even be a cause.

Could you tell us a bit more and maybe we can flush out where the problem lies?

acaliaro commented 1 year ago

thanks @pglombardo

manual aknowledgemnt... how can I take a look to this?

pglombardo commented 1 year ago

Message acknowledgement is automatic unless you decide to handle that on your own - so you would likely already know if your application is doing this. It would require calling message.mqtt5Publish.acknowledge().

An specific example would depend on what interface you are using (blocking, async or reactive) but here is one example in #481. Search the code for acknowledge.

Some other questions to reduce the problem area:

pglombardo commented 4 months ago

Hi @acaliaro - did you ever make any progress on this issue?

acaliaro commented 4 months ago

Hi, no. I am not working on the project anymore

pglombardo commented 4 months ago

Ok - thanks for the update e saluti dalla Sicilia :-)