Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threads not closed #14

Closed
Todd-Davies opened this issue Jun 8, 2012 · 6 comments
Closed

Threads not closed #14

Todd-Davies opened this issue Jun 8, 2012 · 6 comments

Comments

@Todd-Davies
Copy link

Hi,

According to the DDMS tool, the ImageLoader doesn't close the threads in the thread pool for the executorService.

This is a rather large memory issue is it not?

@thest1
Copy link
Owner

thest1 commented Jun 13, 2012

Right, threads are not closed. They're cached to serve more requests. They will be killed when application is killed. I don't think they consume any reasonable amount of memory so I would not bother about that. It's a thread pool, you don't want to start a new one for every image, you want them to be cached.

@thest1 thest1 closed this as completed Jun 13, 2012
@Todd-Davies
Copy link
Author

Ahh, I see your argument ;) It's just that I had an application with a number of activities using the image loader and so ended up with about 50 threads :P

@thest1
Copy link
Owner

thest1 commented Jun 13, 2012

ImageLoader should be only one per application. This way memory cache is most effective.

@Todd-Davies
Copy link
Author

Ahh, how do you suggest I get around my problem of having it in many different activites. I have a selection of lists, galleries and image views using the class. Btw, do you want to move this to stack overflow?

@thest1
Copy link
Owner

thest1 commented Jun 13, 2012

Yes, just have only one instance of ImageLoader. You can place it to Application class of make it static member of any other class.

@Todd-Davies
Copy link
Author

Ahh I see. I'm not working on this project for a month or two, but when I get round to it, I'll tell you how it's gone. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants