This issue is not related to event/device history size. It should be addressed (or at least greatly reduced) in upcoming 2.2.9 update. Sorry about that...
Please schedule a daily reboot using Rule Machine or a community rebooter app in the meantime. Database gets compacted on every reboot; if it starts growing, a reboot will bring it back to the baseline.