Sorry for creating a new ticket that is exactly the same as the previous.
Jake told me to create a single Picasso instance and use it everywhere. The problem wasn't solved with this. It still shows me the that Too many files are open, with errorno=24
This only happens when flinging the listview. I am pausing and resuming the Tag at the OnScrollListener. Or should I cancel the tag?
My small logcat:
E/NativeCrypto﹕ AppData::create pipe(2) failed: Too many open files
art/runtime/indirect_reference_table.cc:77] Check failed: table_mem_map_.get() != nullptr ashmem_create_region failed for 'indirect ref table': Too many open files
I'm hoping that we get to a solution this time, since I'm out of knowhow about solving this issue.
Thanks!
Tim
Show us as much code as possible or create a sample project which demonstrates the problem. Otherwise there's no action we can take here.
Here is the code i use (part of the total code)
http://pastebin.com/W2A8u7Ex
What might be the issue, is that there are 2 ListViews loading side by side, due to the Tabs (Android loads the tab next to the current tab, and that is also a tab with heavy image loading)
Line 34, line 64, line 68, and line 84 are creating new Picasso instances. Call .build() _once_ and re-use the same instance everywhere. You can also call Picasso.setSingletonInstance() with that instance which will make Picasso.with() return your custom instance so that you don't have to pass it around manually.
Thanks JakeWharton! that solved my issue. The singleton instance of Picasson is really the key. thanks.
I have to say thanks JakeWharton too. "Call .build() once and re-use the same instance everywhere." suggestion worked well :)
@JakeWharton What is or are the downsides of creating a new instance every time ?, is this a bad practice ?. I know you are a busy man, but I'd like to know this for knowledge purposes, so whenever you've the time, I'd appreciate if you can shed some light on this.
It creates about 5 threads for each request which don't go away until they
time out after a minute. You'll very quickly exhaust available memory or
file handles or both.
On Fri, Jan 12, 2018 at 3:20 AM s1mar notifications@github.com wrote:
@JakeWharton https://github.com/jakewharton What is or are the
downsides of creating a new instance every time ?, is this a bad practice
?. I know you are a busy man, but I'd like to know this for knowledge
purposes, so whenever you've the time, I'd appreciate if you can shed some
light on this.—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/square/picasso/issues/1100#issuecomment-357172440,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEESOwQbKQAs0UEewbdZ6MtDh8W1BQks5tJxXTgaJpZM4Fm2AW
.
@JakeWharton Thank you sensei !
Most helpful comment
Line 34, line 64, line 68, and line 84 are creating new Picasso instances. Call
.build()_once_ and re-use the same instance everywhere. You can also callPicasso.setSingletonInstance()with that instance which will makePicasso.with()return your custom instance so that you don't have to pass it around manually.