eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.12k stars 884 forks source link

ConcurrentHashMap inboundQoS2 in org.eclipse.paho.mqttv5.client.internal.ClientState takes up over 100MB of HeapSpace #1018

Open flo89 opened 1 year ago

flo89 commented 1 year ago

Is this a normal behaviour that this single HashMap is using almost 50% of the applications total HeapSpace?

It doesn't seem to increase anymore although the message load is still the same.

image

I enabled logging and it seems that

https://github.com/eclipse/paho.mqtt.java/blob/570ed6eeaba81b0865821fed6de0d36142fedfde/org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/client/internal/ClientState.java#L1532 or https://github.com/eclipse/paho.mqtt.java/blob/570ed6eeaba81b0865821fed6de0d36142fedfde/org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/client/internal/ClientState.java#L1542

are never called.

In the mosquitto log I see that the 4-Part Handshake was sucessfully

1695792469: Received PUBLISH from DEFAULT/s7tcp (d0, q2, r1, m632, 'DEFAULT/s7tcp/dev1/REAL1', ... (3 bytes)) 1695792469: Sending PUBREC to DEFAULT/s7tcp (m632, rc0) 1695792469: Received PUBREL from DEFAULT/s7tcp (Mid: 632) 1695792469: Sending PUBLISH to DEFAULT/hmi (d0, q2, r0, m1199, 'DEFAULT/s7tcp/dev1/REAL1', ... (3 bytes)) 1695792469: Sending PUBCOMP to DEFAULT/s7tcp (m632) 1695792469: Received PUBREC from DEFAULT/hmi (Mid: 1199) 1695792469: Sending PUBREL to DEFAULT/hmi (m1199) 1695792469: Received PUBCOMP from DEFAULT/hmi (Mid: 1199, RC:0)