FAQ
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
time.

I look up in the android-ndk groups and find this article:
http://groups.google.com/group/android-ndk/browse_thread/thread/b1fe7ac5523249f2

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?

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

Search Discussions

  • Simon Zhu Chn at Feb 28, 2012 at 9:56 am

    On 2月27日, 上午11时36分, "simon.zhu....@hotmail.com" wrote:
    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
    time.

    I look up in the android-ndk groups and find this article:http://groups.google.com/group/android-ndk/browse_thread/thread/b1fe7...

    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?

    Is there anyone can help me?

    --
    You received this message because you are subscribed to the Google Groups "android-ndk" group.
    To post to this group, send email to android-ndk@googlegroups.com.
    To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
  • Nasif Noorudeen at Feb 28, 2012 at 11: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

    Thanks

    Nasif
    2012/2/28 simon.zhu.chn@hotmail.com <simon.zhu.chn@hotmail.com>

    On 2月27日, 上午11时36分, "simon.zhu....@hotmail.com"
    wrote:
    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
    time.

    I look up in the android-ndk groups and find this article:
    http://groups.google.com/group/android-ndk/browse_thread/thread/b1fe7...
    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?

    Is there anyone can help me?

    --
    You received this message because you are subscribed to the Google Groups
    "android-ndk" group.
    To post to this group, send email to android-ndk@googlegroups.com.
    To unsubscribe from this group, send email to
    android-ndk+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/android-ndk?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "android-ndk" group.
    To post to this group, send email to android-ndk@googlegroups.com.
    To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
  • Tor Lillqvist at Feb 28, 2012 at 4:44 pm

    Dont worry about number of shared library you are loading into the memory.
    You can load whatever number of library in to memory.

    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".

    --tml

    --
    You received this message because you are subscribed to the Google Groups "android-ndk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/ZgwtMVu--wUJ.
    To post to this group, send email to android-ndk@googlegroups.com.
    To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
  • Stephen Williams at Feb 28, 2012 at 5:16 pm

    On 2/28/12 8:44 AM, Tor Lillqvist wrote:
    Dont worry about number of shared library you are loading into the memory. You can load whatever number of library in to memory.

    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".
    Could be changed in future versions of dllib, or you could include your own modified dllib (bad if compatibility changes...).

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupandroid-ndk @
categoriesandroid
postedFeb 27, '12 at 3:20p
activeFeb 28, '12 at 5:16p
posts5
users4
websitedeveloper.android.com...

People

Translate

site design / logo © 2019 Grokbase