2

Fresco library is using native memory to store cahced bitmaps for android version 4.x. Is there any way to disable this feature and use only java heap for cache?

nnesterov
  • 1,232
  • 1
  • 10
  • 27
  • Why do you want to do that? – Alexander Oprisnik Feb 09 '17 at 10:22
  • @AlexanderOprisnik I have too many native crash in my app. I'm trying to check if it's caused by Fresco. Am I wrong? – nnesterov Feb 09 '17 at 10:28
  • Do you have a stack trace for a native crash? How are you using Fresco? Just SimpleDraweeView and setting URIs? – Alexander Oprisnik Feb 09 '17 at 11:40
  • @AlexanderOprisnik I use SimpleDraweeView for remote and local images, resizing, some set of visual effects: rounding corners, overlays. – nnesterov Feb 10 '17 at 10:26
  • Unfortunately I have not stack trace cause I cannot reproduce crash on own devices. But crashlytics dashboard is full of native crashes on users' devices. Fresco is only native lib used in project. I have completely no idea what to do. So I want to perform some kind of experiment. I want to forbid fresco to use native memory and check if it will help me. Doesn't it have any sense? – nnesterov Feb 10 '17 at 10:31
  • Without knowing what's going on, it's hard to find the underlying issue. Fresco uses native code in a couple of places. If you don't have a stack trace, how do you know that the issue is related to ashmem in the first place? – Alexander Oprisnik Feb 10 '17 at 11:47
  • @AlexanderOprisnik Most of native crashes in my app occur on Android version 4.X. Fresco doesn't use ashmem since 21 sdk, does it? Of course I'm not sure that asmem makes crashes. It's just one of my assumptions But I want to take this expirement to exclude ashmem from list of possible causes. – nnesterov Feb 10 '17 at 13:07
  • It's not easily possible to change any of this right now. We have native code that we need for several things (where there is no Java implementation) and without changes to the library itself, it's also not possible to disable ashmem I believe. – Alexander Oprisnik Feb 10 '17 at 15:52
  • @AlexanderOprisnik Many thanks for your help! Maybe you convert your comment to answer? It would be great. Someone can miss your last comment. – nnesterov Feb 10 '17 at 16:39
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/135404/discussion-between-nnesterov-and-alexander-oprisnik). – nnesterov Feb 10 '17 at 17:18

1 Answers1

1

It's not easily possible to change any of this right now. We have native code that we need for several things (where there is no Java implementation) and without changes to the library itself, it's also not possible to disable ashmem I believe.

Alexander Oprisnik
  • 1,212
  • 9
  • 9