Flutter: Exhausted heap space, trying to allocate 8589934608 bytes and laptop stops responding

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,

  1. flutter clean
  2. Restart my android studio

But Error occur again and again and my laptop sotps responding.

How to resolve this issue?

Solution to answer:

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.