-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Glide munching on memory #1560
Comments
Sorry, my mistake. It was my placeholder drawable |
Yep, that's what I was about the write :) Tip: With signature you're not replacing the cache key, but adding to it, so it will be Tip: to make efficient use of Glide, you should consider using a |
With Dropbox's APIv2 it's a bit more complicated than endpoint + url. url is unique for each file so can it serve as an identifier? I need only 2 corners rounded. Is there a Transformation for that? ...
.asBitmap()
.signature(new StringSignature(url))
.imageDecoder(decryptingDecoder)
.cacheDecoder(new FileToStreamDecoder<>(decryptingDecoder))
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
... Will the transformation still help in this case? |
As for the placeholder I had a 1024*1024 drawable. Doesn't Glide shrink it to match ImageViews? Do I need a smaller placeholder or there is a way to reduce its size to display? |
Glide doesn't touch the placeholder just calls Yes, glide-transformations linked from Compatibility contains a Regarding DropBox: I assume you have something like
I was guessing this is not what you were looking for., but instead you want to load |
Caching is much better with this approach. Thank you. However, thumbnails/placeholders are not displayed while the images are being loaded. It seems I am missing something. Please give me some hints Here's my code: Glide.with(context)
.load(glideUrl)
.asBitmap()
.thumbnail(Glide.with(context).load(R.drawable.placeholder).asBitmap().centerCrop())
.signature(new StringSignature(url))
.centerCrop()
.diskCacheStrategy(DiskCacheStrategy.SOURCE) |
Hmm, no idea on that yet, maybe your main load is faster than the thumbnail so there's no need to display? Thumbnail will only show if it finishes before the main load, and there will be a small time when nothing is shown (while it's being read from cache), after the first load, memory cache should be used so display is immeditate. |
Play around with |
yes, after the cache is filled, it's immediate. but after cleaning the cache it takes about 2-3 seconds to display the images. and in that time thumbnails/placeholders are not shown. |
Here are the logs. Not sure what exactly they are saying
|
The two Further: Did you add Can you please redo this with both listeners added and timestamps? And also enable internal logging. Also include your Glide current version of the load line to avoid confusion. |
Sorry for long pause. You are right, I am not using animation because i need .asBitmap(). Animations don't work with that.
|
Wow, 10 seconds... we need to see what's Glide doing between those two lines as I said above: https://github.com/bumptech/glide/wiki/Debugging-and-Error-Handling#more-logging Btw, I implemented animations for |
Thank you. I will wait for 3.8 release as those animations are not that nescessary for now.
|
That looks like a slow server, Glide cannot boost your connection, nor upgrade your hardware ;) |
Having slow load speed is ok. But thumbnails/placeholders are a problem. |
Not sure what's going on with your placeholder drawable, it's likely not a bitmap: #350 |
Hello.
I am using Glide version
compile 'com.github.bumptech.glide:glide:3.7.0'
with no integration libraries and bumped into OutOfMemoryException on a Nexus Player running 7.0 when trying to load an image into an ImageView with rounded corners ('com.joooonho:selectableroundedimageview:1.0.1') which extends ImageView.
Memory allocation tracker shows the following:
My code:
I need the 'asBitmap()' to implement custom ImageDecoder later on.
Am i missing something?
The text was updated successfully, but these errors were encountered: