Hi fadden,

Thank you for your reply.

I would like to ask you again the question about as ashmem porting on
Vxworks. As I said with you in the previous message that due to
Vxworks does not support mmap/munmap fuction, so the first time I
replaced them by function malloc/free and this seems that this cannot
work well.

With malloc/free, a simple test app just call System.gc() will be was
blowing up. And I cannot invoke to run a Java app again. I can only
run one time, if I invoke to run again, Dalvik crashes when it starts
up.

Then I tried to replace malloc/free by calloc/free and it seems that
Dalvik can work better. With heap size 4MB, I can run my simple test
app with System.gc can work well and I can invoke to run a simpple
test many times but Dalvik did not crash.

My issue is with calloc/free and heap size about 32MB. I only can run
my sample app 2 times. If I try to run again (3rd time), Dalvik will
crash and I see the message:

0x8a3c9e10 (tDnsPro): memPartAlloc: block too big - 132360 in
partition 0x823aa9f8.
0x8a3c9e10 (tDnsPro): memPartAlloc: block too big - 132360 in
partition 0x823aa9f8.

This message also displays when I reduce heap size to 8MB and run my
app to test (my app is rather more complex than my simple test) and it
only can run about 5 times and then display above message and crash.

The stack trace for crash is stack trace that I used to paste in the
top of this message:

stack trace information:
    SP:0x8ee01690(unknown stack base:0x8fa00000)
    0x8006f5b0:bfill + 0x68
    0x80e56980:memset + 0x20 -> bfill()
    0x80c4320c:mspace_malloc_stats + 0x1b4 -> memset()
    0x80c43308:create_mspace_with_base + 0x68 -> mspace_malloc_stats()
    0x80c4341c:create_contiguous_mspace_with_name + 0xec ->
create_mspace_with_base()
    0x80cbe390:dvmHeapSourceShutdown + 0xe0 ->
create_contiguous_mspace_with_name()
    0x80cbeb5c:dvmHeapSourceStartup + 0xa4 -> dvmHeapSourceShutdown()
    0x80c73ed8:dvmHeapStartup + 0x28 -> dvmHeapSourceStartup()
    0x80ca16a8:dvmStartup + 0xa0 -> dvmHeapStartup()
    0x80ca9bdc:JNI_CreateJavaVM + 0x1ec -> dvmStartup()
    0x80c4ff24:dalvik_main + 0x144 -> JNI_CreateJavaVM()
    0x80c505c0:DalvikStart + 0x48 -> dalvik_main()
    0x80e6fb58:yyparse + 0x1370 -> DalvikStart()
    0x80e70814:execute + 0x19c -> yyparse()
    0x80e70558:shellPromptSet + 0x4e0 -> execute()
    0x80e708ec:shell + 0xb4 -> shellPromptSet()
    0x80072b68:vxTaeskEntry + 0x14 -> shell()
core1:

For memPartAlloc message, I think that maybe when Dalvik exits, it did
not free memory so it leads to leak memory and so if we invoke to run
several times, it cannot get enough memory to allocate for heap size
and cannot start again. So I think that with heap size only 4MB and if
I invoke my simple test app many times , maybe Dalvik will be crashed
too ( with 32MB heap size, it crashed at 3rd time running).

So could you let me know your idea in this case?

and could you help to show me which memory and resource will be freed
when Dalvik exits?

If maybe in my case, memory and resource did not free, how can I check
and free all memory when Dalvik exits?

Many thanks for your help.
BR

On Jul 23, 1:17 am, fadden <[email protected]> wrote:
> On Jul 22, 6:04 am, Mercury <[email protected]> wrote:
>
> > However on Vxworks, when exiting a thread, it does not free its
> > resource. So for example I create a server socket on Java
>
> > server = new ServerSocket(port);
>
> > and make it listening. After I terminate this thread in native, server
> > socket I created still alive.
>
> You may just need to call server.setReuseAddress(true).
>
>  http://java.sun.com/javase/6/docs/api/java/net/ServerSocket.html#setR...)
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to