In
Java there is not way to force garbage collection and there is also no way to determine how much memory would be freed if garbage collection occurs.
You can ask Java to run garbage collection by running
System.gc() but that request may be ignored.
Given that you cannot enforce garbage collection using Java, you cannot know how much memory will be freed up when garbage collection happens.
But we are talking about Android and an alternative to using Java for Android programming is to use C or C++.
I do not know C or C++ enough to know how this is implemented in general or how it's implemented in Android.