Hi.

I am facing a strange native memory leak in my application, can
someone help me please?

The leak heppens after change the language of the phone in settings.
Before changing the language, I have just opened the application and
ran dumpsys meminfo in the process. The result was that the process
had 18495 KB total memory allocated, which were 11704 KB native and
6791 KB dalvik.

After changin language for the first time, opening the app again and
running dumpsys meminfo onge more time, the result was that the
process had 24115 KB total memory allocated, which were 17324 KB
native and 6791 KB dalvik.

Looking the heap size in DDMS I saw the process had a total of 6 MB,
which makes sense with the 6791KB of dalvik memory allocated. Changing
the language again makes the total allocated memory grow, getting to
29335 total memory allocated, which were 22544 KB native and 6791 KB
dalvik.

As you can see, it is only the native part that grows, therefore using
Eclipse MAT on the generated HPROF file does not give any good leak
suspects.

We are passing the application context instead of the activity context
as explained in the article 
http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html

I compared the results with other applications in the phone, and saw
that it is common to the memory allocated to grow in the first time
the language is changed, but the amount of memory is kept unchanged in
the subsequent changes for those other applications.

I also read that "DDMS does not report memory that is allocated on
your behalf on the native side", but than, how can I make sure that
memory will be freed? Also, the content of the native memory must be
connected to the dalvik amount of memory, how can I find that
connection??

I am getting out of ideas, did anyone see something similar or have
any hints for me?

Thanks in advance!!
Cheers!!
Pedro

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to