开发者

oops! OutOfMemoryError

guys. my problem is OutOfMemoryError Exception. but anyhow i controlled it a lot using system.gc() and clearing my stuff as soon as its not require开发者_StackOverflow社区d, but system.gc is not working for android 1.5 and 1.6 framework. and hence i am not able to control OutOfMemoryError on 1.5 and 1.6. for rest of releases application works fine. is this a problem of lower version releases or something else????? I tested it a lot , it works fine from android 2.0 onwards


As far as I know, System.gc() won't save you from OutOfMemoryError. It's not caused by excessive garbage (objects with no references), but it may be caused by too much referenced objects in the heap. So, try to look for memory leaks in your program. Example: you add elements to a list or hash map, but never remove them. They remain referenced in the heap, and GC cannot collect them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜