I have a piece of code that load a very big image in memory. So it seemed like a reasonable thing to call
System.gc();
before loading the
You already got plenty of good advice, which I will try not to reiterate.
If you actually get problems with the GC, like full stops of your application for a second, do the following: 1. check that there aren't any calls to System.gc(); 2. check out the various options for configuring the gc. There are tons of those around, and they are much more helpful, then forcing gc.