0

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 required, 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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

- whats your idea about the code at this link codereview.stackexchange.com/questions/943/…. I released all objects but it still shows OutOfMemoryError.
@Shashank_Itmaster: wrote you an answer there

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.