We all know that Dalvik has a stack and a heap. There are objects created during the execution of Java code. Objects are in Dalvik-heap.

And where are the native objects that were created by calling the native functions stored.

I explain. Call the function from the native. During its execution, objects and local variables are created. Where are they stored? It is unlikely that all this goes on inside Dalvik.

    1 answer 1

    Dalvik is, if you can put it that way, “simple software” that runs in the depths of the operating system, the kernel of which is Linux.

    Native functions written, for example, in C ++, do not need a virtualized environment, such as Dalvik. Accordingly, what is used outside of this very “simple software” (virtual machine) works and stores its data outside of its limits, i.e. in the target OS.

    To understand at what level ("sandwich OS Android") the native code is executed, it will be enough just to look at the device layout of this OS: HAL

    In general, of course, the question is good, from a philosophical point of view.