Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Er, is there a version without memory leaks?

Sadly retained messages aren't implicated in my problem. But thanks for the data point.

Andrew

On Thu, 23 May 2019 at 11:46, Kurt Van Dijck <dev.kurt@xxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi Andrew & Roger,

I work on an embedded ECU that processes roughly 1200msgs/sec,
with the majority of the retained payloads 10-20 bytes long,
I experienced heap growth too (using mosquitto 1.5.1).

My analysis was that the server pool of retained topics suffered from
heap fragmentation, and so kept growing, but I didn't manage to prove
that.
I planned to raise the question on this list, but got bytes to burn ...
and I managed to mitigate the problem by changing
MOSQ_PAYLOAD_UNION_SIZE from 8 to 32.

Kurt

On wo, 22 mei 2019 12:38:14 +0100, Roger Light wrote:
> Hi Andrew,
>
> Thanks for addressing this in a considerate way. Assuming this is a
> real problem, I'm very keen to sort it out. I use valgrind all the
> time, the mosquitto tests can run under valgrind and
> test.mosquitto.org is almost always running under one valgrind tool or
> another these days.
>
> When mosquitto exits I don't see any leaks in the valgrind "definitely
> lost" sense, but that just means the memory is being freed at the end.
> It could be, for example, that messages are being stored that are
> never subsequently used by a client but aren't removed until the end.
>
> Are you able to share any more details about your setup, such as the
> config, the pattern of topics that is in use, what client settings you
> are using - "clean session" being the important one, and whether
> messages are retained? If there's anything you'd prefer to share
> privately that is fine as well.
>
> Regards,
>
> Roger
>
> On Wed, 22 May 2019 at 10:40, Andrew Hilborne <andrew@xxxxxxxxxxxx> wrote:
> >
> > Sorry to ask such a rude question.
> >
> > We have been running an old version (1.4.14) for some time on our IoT fleet. I don't know how busy some people's servers are, but I would think ours are 'medium busy': we ship around 800kB/1200 messages per minute. Some stats are at the end of this message.
> >
> > We have always suffered from an apparent memory leak. I.e. the heap keeps growing. This crashes our machines after several days. Here's what the heap looks like before that:
> >
> > $SYS/broker/heap/current 37769512
> > $SYS/broker/heap/maximum 37782576
> > $SYS/broker/heap/current 37772776
> > $SYS/broker/heap/current 37776040
> > $SYS/broker/heap/maximum 37783000
> >
> > .. and here's a v1.5.8 after ~ 15 hours. As you can see, it's growing too:
> >
> > $SYS/broker/heap/maximum 16341692
> > $SYS/broker/heap/current 16340424
> > $SYS/broker/heap/maximum 16344940
> > $SYS/broker/heap/current 16343672
> > $SYS/broker/heap/maximum 16348188
> >
> > Hence my question about memory leaks. If a later version has fixed these problems, please let me know. Else I can try valgrind and get back to the list.
> >
> > Many thanks!
> >
> > Andrew Hilborne
> >
> > --8<---------------8<---------------8<---------------8<------------
> > Here are some more stats from v1.5.8:
> >
> > $SYS/broker/version mosquitto version 1.5.8
> > $SYS/broker/uptime 66165 seconds
> > $SYS/broker/clients/total 8
> > $SYS/broker/clients/inactive 0
> > $SYS/broker/clients/disconnected 0
> > $SYS/broker/clients/active 8
> > $SYS/broker/clients/connected 8
> > $SYS/broker/clients/expired 0
> > $SYS/broker/clients/maximum 9
> > $SYS/broker/load/messages/received/1min 339.34
> > $SYS/broker/load/messages/received/5min 339.86
> > $SYS/broker/load/messages/received/15min 339.78
> > $SYS/broker/load/messages/sent/1min 696.40
> > $SYS/broker/load/messages/sent/5min 767.64
> > $SYS/broker/load/messages/sent/15min 761.36
> > $SYS/broker/load/publish/dropped/1min 0.00
> > $SYS/broker/load/publish/dropped/5min 0.00
> > $SYS/broker/load/publish/dropped/15min 0.00
> > $SYS/broker/load/publish/received/1min 332.50
> > $SYS/broker/load/publish/received/5min 332.28
> > $SYS/broker/load/publish/received/15min 332.11
> > $SYS/broker/load/publish/sent/1min 689.55
> > $SYS/broker/load/publish/sent/5min 760.07
> > $SYS/broker/load/publish/sent/15min 753.68
> > $SYS/broker/load/bytes/received/1min 327277.76
> > $SYS/broker/load/bytes/received/5min 323647.33
> > $SYS/broker/load/bytes/received/15min 322932.85
> > $SYS/broker/load/bytes/sent/1min 858260.42
> > $SYS/broker/load/bytes/sent/5min 849654.01
> > $SYS/broker/load/bytes/sent/15min 847230.58
> > $SYS/broker/load/sockets/1min 0.06
> > $SYS/broker/load/sockets/5min 0.27
> > $SYS/broker/load/sockets/15min 0.39
> > $SYS/broker/load/connections/1min 0.06
> > $SYS/broker/load/connections/5min 0.27
> > $SYS/broker/load/connections/15min 0.39
> > $SYS/broker/messages/stored 52
> > $SYS/broker/messages/received 374681
> > $SYS/broker/messages/sent 768738
> > $SYS/broker/store/messages/count 52
> > $SYS/broker/store/messages/bytes 294
> > $SYS/broker/subscriptions/count 62
> > $SYS/broker/retained messages/count 52
> > $SYS/broker/heap/current 17641032
> > $SYS/broker/heap/maximum 17646888
> > $SYS/broker/publish/messages/dropped 0
> > $SYS/broker/publish/messages/received 365915
> > $SYS/broker/publish/messages/sent 759973
> > $SYS/broker/publish/bytes/received 341141939
> > $SYS/broker/publish/bytes/sent 920239789
> > $SYS/broker/bytes/received 355765521
> > $SYS/broker/bytes/sent 933347599
> > _______________________________________________
> > mosquitto-dev mailing list
> > mosquitto-dev@xxxxxxxxxxx
> > To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> > https://www.eclipse.org/mailman/listinfo/mosquitto-dev
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/mosquitto-dev
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/mosquitto-dev

Back to the top