0

Whether system.gc will avoid android's out of memory exception for bitmap?

jmj
  • 237,923
  • 42
  • 401
  • 438
surya
  • 477
  • 1
  • 7
  • 19
  • No, it won't. A gc is done automatically if memory is low. Btw, this problem has been discussed many times. If you have this problem in a debugger only, it's a known problem with memory leaks through exceptions. If not, then you're leaking bitmaps, or using too large bitmaps. – EboMike Dec 31 '10 at 10:14
  • i have found that System.gc() brings improvement with rather big bitmaps but you can not rely on it. – mad Dec 31 '10 at 13:00

1 Answers1

1

System.gc() is just an request to jvm to execute gc, you cannot 100% be sure that it will get executed upon System.gc() invocation .

See Also :

Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438