wood burning stoves 2.0*
The moose likes Android and the fly likes Garbage collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Garbage collection" Watch "Garbage collection" New topic
Author

Garbage collection

Pratik Goswami
Ranch Hand

Joined: Mar 02, 2009
Posts: 136

Hello everyone!!

The common problems I have found for android is memory exception. Being a mobile application developer we have to be more conscious about memory usage for running apps. Is the Garbage collection based on Activity life cycle?

Thanks
Pratik Goswami


iOS * Android Developer
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4531
    
    5

There's a forum devoted to Android
http://www.coderanch.com/forums/f-93/Android


luck, db
There are no new questions, but there may be new answers.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19680
    
  18

Which is where I will move this thread.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

Is the Garbage collection based on Activity life cycle?

I don't think Garbage collection is tied with Activity life cycle in particular. The collector itself(or its optimizing engine) is expected to determine the best time to perform a collection. It is based on the allocation being made; eventually GC will run.
For example, before getting an OutOfMemoryError, collection is guaranteed to have been performed once.

Instead of focusing on the times when the collection is done, try to keep Memory leaks in check and avoid creating objects where ever possible.


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

I think you might also find this exercise interesting: Determine when Android GC runs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Garbage collection