https://kotlinlang.org logo
Title
t

Tung97 Hl

02/01/2023, 7:40 AM
Hi guys I have another issue with the r*ecomposition again.* 😂 The detail in the thread. Please take a look.
Now my Numpad is inside InputAmountScreen. I think it is not a trouble.
I called InputAmountScreen inside HomeScreen
Here is my AppBottomBar
My problem is: I have no idea why now the numpad and the input amount screen is recomposed whenever I press any button in numpad
Please help 🥲
b

Ben Trengrove [G]

02/01/2023, 8:10 AM
First off, I wouldn't stress about this unless it's causing you some sort of jank
But is it just because when you push a button, inputText is updated which causes a recompostion?
t

Tung97 Hl

02/01/2023, 8:14 AM
I don’t know why. Whenever I press the button, the view gets recomposed and increases memory (and it can not be free until I leave this screen). So no jank here, but the memory issue makes me worry.
Then I think maybe the unnecessary recomposition here is the cause of memory issue.
b

Ben Trengrove [G]

02/01/2023, 8:15 AM
It doesn't look unnecessary to me
Your state is changing and so it recomposes
That's just working as normal
t

Tung97 Hl

02/01/2023, 8:19 AM
So what about the memory increase? Do you have any idea about the root cause?
Because my targeted device is very weak (only 1gb ram) so if memory can not be free I will be triggered haha
b

Ben Trengrove [G]

02/02/2023, 10:13 PM
Is it that garbage collection just hasn't run yet? Does it go down when you force flush it?
t

Tung97 Hl

02/03/2023, 3:43 AM
yes.
b

Ben Trengrove [G]

02/03/2023, 4:03 AM
That means it is all working correctly
t

Tung97 Hl

02/03/2023, 4:16 AM
Thank you :kotlin-intensifies-purple: