When I run my flutter project it was giving me this error below, making my laptop stops responding.
Exhausted heap space, trying to allocate 8589934608 bytes
Screenshot:
I am trying,
But Error occur again and again and my laptop sotps responding.
How to resolve this issue?
Some times flutter clean works for me.
But When flutter clean does not work then I apply below technique:
I push my project to git repository(I used Bitbucket) and delete this existing project. Then pull my project from git repository and setup my project. After all my project working as usual.
Try flutter clean
along with flutter channel master && flutter upgrade
Thanks @Md Mahmudul Islam. In my case one extra steps solved the issue smoothly.
-Flutter Clean
-Flutter upgrade [upgrade 1.17.2 to 1.17.4]
-Increase Android studio Heap memory :
Program Files->Android->Android Studio->bin->studio64.exe.vmoptions
Open the file and increase the value -Xmx1280m as you want. I changed -Xmx1280 to -Xmx2280
You can also see on bottom right corner, how much memory used in your program by enabling this
File->Settings->Appearance->check 'Show memory indicator'
Note : Try to upgrade Flutter on Latest stable version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With