Home assistant hanging and not record data with high cpu and memmoru use

Yesterday I encounter a problem with home assistant and I don’t know why:
From 5pm home assistant use too much ram and cpu as graph bellow:


Even when I restart home assistant the cpu and ram use reduce at first and continue to rising again. Un till about 10pm, Home Assistant become hanging at recording and logging data.


You can see the ‘flat’ line. But web interface still responsible. To return to the normal operation I must restart Home Assistant when the recording and logging hang ( when recording and logging not hang and CPU and Ram continue rising restart home assistant don’t work (you can see the lower peak at 9pm))

I use: Home assistant 0.82.1, MariaDB, Node-red, Raspbian stretch, on RPI 3B+. Do any one encounter this problem ?