문제

My understanding is that the .dlls are loaded into java.library.path by a ClassLoader but where are they stored in memory after System.loadLibrary() and System.load() is called from a non-static procedure?

JVM Internal Architecture

도움이 되었습니까?

해결책

When the System.loadLibrary() or System.load() functions are called, the ClassLoader for the current Java class is tasked with finding the requested DLL (and its dependencies) and informing the operating system about the libraries' locations. The ClassLoader itself does not perform any loading: this operation uses the Java Native Interface (JNI) libraries to communicate with the operating system and tells it where to look for the requested libraries.

When a DLL function is called, the function is loaded into the address space of the Java VM process and is executed there. This address space is a memory block given to a process by the operating system and is separate from the Java VM altogether. So, the answer to your question is that the Java VM simply uses its given address space to load DLL functions on-demand and executes them through the Java Native Interface.

Source: http://www.webbasedprogramming.com/Tricks-of-the-Java-Programming-Gurus/ch30.htm

다른 팁

'Non-static procedure' has nothing to do with it. Neither does the Java heap, and neither does Java, or your picture. The code is mapped into the process's code space and the data is mapped into the process's data space.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top