|when does dalvik unload shared library||simon....@hotmail.com||2/26/12 7:36 PM|
this is really puzzle me lately moment.
I'm writing a application, and part of it use ndk. there is some
function may use native thread to download file.
I want to the download thread keep run even if the application has
called onDestroy(), but will the dalvik unload the shared library at
same time? If so, I think my application stop download task at same
I look up in the android-ndk groups and find this article:
where fadden says the shared library is never unloaded. but here I get
a puzzle, if the shared library is never unloaded, then if I load a
lot of shared libraries. will the system goes to a memory shortage?
how dalvik manage these shared libraries when a Activity ends its
lifecycle? Can anyone illustrate it for me?
|Re: when does dalvik unload shared library||simon....@hotmail.com||2/28/12 1:55 AM|
On 2月27日, 上午11时36分, "simon.zhu....@hotmail.com"
<simon.zhu....@hotmail.com> wrote:> I look up in the android-ndk groups and find this article:http://groups.google.com/group/android-ndk/browse_thread/thread/b1fe7...
>Is there anyone can help me?
|Re: when does dalvik unload shared library||nasif||2/28/12 3:45 AM|
Dont worry about number of shared library you are loading into the memory. You can load whatever number of library in to memory. Since library is loading in to the stack memory of ram not in heap memory of process, when they process is no longer using os will remove the libs
When you are agian launching application os will load the lib if it not present for the same process. I load up to 5 shared lib at same time
2012/2/28 simon....@hotmail.com <simon....@hotmail.com>
|Re: when does dalvik unload shared library||Tor Lillqvist||2/28/12 8:44 AM|
Actually, on Android, you can't. At least not if you use the system's dynamic linker (dlopen()): http://androidxref.com/source/xref/bionic/linker/linker.c#55
Yes, most people probably would say 128 "should be enough for anybody".
|Re: when does dalvik unload shared library||Stephen Williams||2/28/12 9:16 AM|
Could be changed in future versions of dllib, or you could include your own modified dllib (bad if compatibility changes...).