Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] max system memory and mosquitto persistence file size limit

Hi,

I am bridging mosquitto brokers and uses the persistence file for
storing messages during network connectivity loss(reboot). The system
uses eMMC card as disk and so would like to avoid virtual memory/swap
usage.  I would like to know if below two assumptions are correct. The
assumptions ignore virtual memory usage.

1. Mosquitto *always* maintains *all messages* in memory db. Even
though mosquitto has a persistence file, the file size will be limited
by max system memory and not by free disk space. So if a system has
512MB RAM and 4GB hard disk space, then max limit of persistence file
will be 512MB.

2. I would like to limit max memory used by mosquitto. I am planning
to do this enabling REAL_WITH_MEMORY_TRACKING in memory_mosq.c, and
returning NULL( ignoring errno ) from _mosquitto_*alloc, functions.
Any further clients requests to connect / publish will fail. Mosquitto
will gracefully continue to run mainloop. But client interactions will
be possible only after mosquitto frees some allocated memory with
_mosquitto_free ( possibly after a network connectivity restore ).

Kindly let me know if the above two assumptions are good.

Thanks,
Kiran.


Back to the top