mqtt_client icon indicating copy to clipboard operation
mqtt_client copied to clipboard

Memory leaks on android with 500 msg/s rate

Open pkozlovskiy opened this issue 2 years ago • 4 comments

Is the benchmark or stress tests for client? How to avoid freeze and memory leak when messages rate about 1k?

pkozlovskiy avatar Sep 08 '22 06:09 pkozlovskiy

There's no benchmark suite that I know of although other users have run the client at a greater message rate than this, I think one user was up to 5000 messages per second.

Not sure what you mean by 'freeze and memory leak', the package is just dart code that runs in the VM, browser or flutter runtime, the runtime handles garbage collection(Dart is a GC language, there should be no memory leaks), it also handles runtime aspects of the platform such as networking for instance.

How do you know this is a problem with the client as opposed to the Dart runtime on the platform you are using?

shamblett avatar Sep 08 '22 07:09 shamblett

I use client in flutter on the Android. In profile mode i see, that on some rate(about 800 msg/s on old tablet, and 2.5k on new phone), the memory growth from 500mb to 1g and not clean, the app in this time freeze.

pkozlovskiy avatar Sep 08 '22 09:09 pkozlovskiy

OK, this may be the runtime GC kicking in or trying to kick in, either way the client can't do anything about this. Does it ever recover from the freeze?

shamblett avatar Sep 08 '22 09:09 shamblett

Sometimes it recover

pkozlovskiy avatar Sep 08 '22 13:09 pkozlovskiy