Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

On Android you should definitely load the images Async and not load them within the draw call.


Even loaded asynchronously, the calls for allocation still cause lag. Unless I am doing something incorrectly?


You can use inBitmap in order to reuse bitmap instances instead of of allocating new objects. If it fits your use-case, Glide is a very modular lib that implements inBitmap. It is true that you will always have to create some objects though. For example with Glide, a DataFetcher is created with each new image request. You should do your best to keep it at a minimum though, with a focus on creating heavy objects only when it is absolutely necessary.

Other than that, lag can come from many things, so if you lag without GC, the only solution is to profile that part of your app.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: