Skip to main content

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

Hi Kiran,

> 1. Mosquitto *always* maintains *all messages* in memory db.

This is correct for current versions of mosquitto. It is unlikely that
this will remain true for future versions.

> 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 ).

That's an interesting idea. In principle I can see what you're trying
to do, in practice I wouldn't want to guarantee that you'll get useful
behaviour. For example, if the call in mosquitto_main_loop()
allocating memory for the pollfds variable fails, the broker will
exit.

Regards,

Roger


Back to the top