2

I have an app which takes photo and then process it in NDK. The image processing is really havy and i want to take different resolution images on different phones. So my simple logic is taking higher resolution image for powerfull images and taking lower res. images on low end devices. There are three criteria first two are memory and cpu, if i take a full res image on low end phone like galaxy s it will crash during the image processing because of lack of memory. And it will take forever to process image. Third one is camera picture sizes. So here is my question, how can i profile a device and decide for the resolution of the image?

PS: I am doing image processing with OPENCV so GPU is not an option. PS2: Since i can't make comments i should clarify that i am not trying to profile my own code i am trying to profile devices that users will use.

user65721
  • 2,833
  • 3
  • 19
  • 28
  • 1
    The answer here seems to be what you want: http://stackoverflow.com/questions/3170691/how-to-get-current-memory-usage-in-android – Erik Nedwidek May 11 '13 at 21:04
  • Thanks for the answer i tried the suggested answer funny thing is when try to get available memory on Galaxy S3 it gives 120 and when i try on Galaxy S it gives 128. So this method don't give any idea of which device is high end. MemoryInfo.threshold looks promising but i don't know it will give consistant results. – user65721 May 12 '13 at 12:34

1 Answers1

1

I suggest Valgrind. It supports ARM-based and X86 Android for profiling and memory leak detection.

Sam R.
  • 16,027
  • 12
  • 69
  • 122