A Java Virtual Machine Memory Access Method and System Based on eBPF
By using eBPF programs to perform Java Virtual Machine memory operations in the kernel, the problems of complex Java Virtual Machine memory access and resource consumption are solved, resulting in faster memory access and higher performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2026-04-03
AI Technical Summary
Existing Java Virtual Machine memory access methods are complex to operate and consume a lot of system resources.
The eBPF program monitors the Java Virtual Machine memory space, maps application-layer memory data to the kernel's storage area, and performs memory operations in the kernel through the eBPF program, thereby reducing Java Virtual Machine memory copying and achieving memory data sharing.
Accelerate Java Virtual Machine memory access speed, reduce system resource consumption, and improve performance and security.
Smart Images

Figure CN116661948B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a Java Virtual Machine memory access method and system based on eBPF. Background Technology
[0002] JVM (Java Virtual Machine) is the environment in which Java programs run. One of the characteristics of the Java language is portability. To achieve this, the JVM provides an intermediate layer of abstraction, decoupling Java programs from the underlying operating system, allowing Java programs to run on different operating systems without modifying the source code.
[0003] The JVM provides an abstract computer model, including processor architecture, memory model, instruction set, class file format, etc., and provides a series of class libraries and runtime environments to support the execution of Java programs. When a Java program is compiled, it does not generate machine code, but rather intermediate code called bytecode. The JVM interprets the bytecode into machine instructions, enabling Java programs to run on different operating systems and hardware platforms.
[0004] Existing JVM memory access typically involves the application calling the JVM memory space at the user level, and then, based on the operating system's requests, performing operations such as reading, averaging, and writing memory data in the kernel. Therefore, the access process involves operations between the user level and the kernel. To increase the speed of existing memory access, methods such as compilers, native memory access, and concurrent programming can be used, but these are all complex and consume system resources. Summary of the Invention
[0005] To overcome the above-mentioned technical defects, the purpose of this invention is to provide a Java Virtual Machine memory access method and system based on eBPF, which solves the problems of complex operation and high resource consumption of existing Java Virtual Machine memory access acceleration methods.
[0006] This invention discloses a Java Virtual Machine memory access method based on eBPF, comprising:
[0007] An eBPF program is provided in advance, which configures a storage area including kernel-level memory data;
[0008] The eBPF program monitors the memory space of the Java Virtual Machine under the application layer to map the memory data under the application layer to the storage area;
[0009] The application issues operation instructions that operate on memory data, and calls native method interfaces to memory space through the Java Virtual Machine;
[0010] The eBPF program obtains the operation instructions through the mapping of the storage area and executes them under the kernel, returning the execution result to the memory space of the Java Virtual Machine;
[0011] The application obtains the execution result of the operation instruction by accessing the memory space of the Java Virtual Machine.
[0012] Preferably, the memory data includes objects, thread stacks, and native method stacks.
[0013] Preferably, the memory data is accessed locally by calling the native access interface in the native library of the Java Virtual Machine. The native access interface passes the function call to the native method interface inside the Java Virtual Machine, and the native method interface passes the function call to the eBPF program.
[0014] Preferably, the native method interface passes function calls to the eBPF program in the following ways:
[0015] The native method interface passes local memory data to the dynamic link library, which then passes function calls to the eBPF program.
[0016] Preferably, the provision of an eBPF program includes:
[0017] Compile an eBPF program that can monitor the memory space of the Java Virtual Machine, and compile the eBPF program into eBPF bytecode using a compiler;
[0018] The eBPF program is loaded into the kernel using a loading tool;
[0019] The eBPF program is mounted to the kernel by calling a tool to monitor and track execution events or function calls under the kernel.
[0020] Preferably, after providing an eBPF program, it further includes:
[0021] Check the running status of the eBPF program.
[0022] Preferably, the application calls the eBPF program to obtain memory data under the kernel through the storage area.
[0023] Preferably, the application issues operation instructions that act on memory data, including:
[0024] The application calls the eBPF program and executes the operation instructions through the application interface function to read, write, update or delete the corresponding memory data;
[0025] The kernel memory data is obtained through the storage area.
[0026] Preferably, a storage region is configured by defining a storage region type, a storage region key type, a storage region value type, and a storage region size; wherein, the storage region type includes any one or more of the following: hash table, array, counter.
[0027] This invention also provides a Java Virtual Machine memory access system based on eBPF.
[0028] It includes the application layer, the kernel, and a pre-provided eBPF program, which configures a storage area including kernel-level memory data;
[0029] The eBPF program monitors the memory space of the Java Virtual Machine under the application layer to map the memory data under the application layer to the storage area, wherein the memory data includes objects, thread stacks and native method stacks;
[0030] Application layer: The application issues operation instructions that operate on memory data, and calls native method interfaces to the memory space through the Java Virtual Machine; the application obtains the execution result of the operation instructions by accessing the memory space of the Java Virtual Machine;
[0031] Kernel layer: The eBPF program obtains the operation instructions through the mapping of storage areas and executes them under the kernel, returning the execution results to the memory space of the Java Virtual Machine.
[0032] Preferably, at the application layer, memory data in the storage area of the eBPF program is obtained through the native method interface in the Java Virtual Machine, and the data in the memory space is adjusted by dynamically accessing the system native library.
[0033] Compared with existing technologies, the above technical solution has the following advantages:
[0034] In this application, partial / all of the kernel-level memory data is copied through the storage area of the eBPF program, while simultaneously mapping the application-level memory data. This enables memory data sharing between the application layer and the kernel. After the application issues operation instructions at the application layer, the Java Virtual Machine (JVM) calls the native method interface. The eBPF program then executes in the kernel to read, write, update, or delete the corresponding memory data, before returning to the JVM. By using eBPF and eBPF Maps to achieve shared memory, the JVM's memory copying is reduced, and the JVM's memory access speed is accelerated. The eBPF program can execute in the kernel without consuming system resources, and data lookup can be performed quickly. It also offers high security and solves the problems of complex operation and high resource consumption in existing JVM memory access acceleration methods. Attached Figure Description
[0035] Figure 1 This is a flowchart of a Java Virtual Machine memory access method and system based on eBPF, as described in this invention, in one embodiment.
[0036] Figure 2 A schematic diagram of a module in one or two embodiments of a Java Virtual Machine memory access method and system based on eBPF.
[0037] Figure label:
[0038] 5- Java Virtual Machine Memory Access System Based on eBPF; 51- Application Layer; 52- Kernel; 53- eBPF Program. Detailed Implementation
[0039] The advantages of the present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments.
[0040] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0041] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0042] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0043] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0044] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0045] In the following description, suffixes such as "module," "part," or "unit" used to denote elements are used only for the convenience of the description of the invention and have no specific meaning in themselves. Therefore, "module" and "part" can be used interchangeably.
[0046] Example 1: This invention discloses a Java Virtual Machine (JVM) memory access method based on eBPF. Through an eBPF program, shared memory is implemented using eBPF technology, reducing JVM memory copying, improving JVM memory access speed, and enhancing JVM performance. For details, please refer to [link to relevant documentation]. Figure 1 and Figure 2 This includes the following steps:
[0047] S10: A pre-provided eBPF program is configured to include a storage area containing kernel-level memory data; the eBPF program monitors the memory space of the Java Virtual Machine under the application layer to map the application-level memory data to the storage area.
[0048] In this implementation, the eBPF program copies part / all of the kernel-level memory data (e.g., by establishing a shared memory area under the kernel) and simultaneously maps the application-level memory data, achieving the collection / fusion of application-level and kernel memory data. When the application layer needs kernel-level memory data, it can directly obtain it from this storage area. At the same time, the eBPF program can perform operations under the kernel, so memory data processing can be carried out under the kernel, and the program's storage area can be synchronously mapped to the application layer without having to access the data through the application layer and then process and return it from the kernel, thereby effectively increasing the Java Virtual Machine memory access speed.
[0049] In this embodiment, the aforementioned storage area is a BPF Map. A BPF Map is a special data structure that can create and store data in the kernel, while allowing application layer applications to read and write this data. Using BPF Maps, it is possible to share state information, such as statistical data and network connection status, between the kernel and the application layer. A BPF Map can be viewed as a "key-value" store, where both the key and the value can be of any data type.
[0050] The aforementioned BPF Map supports various data structure types. Specifically, a storage region is configured by defining its type, key type, value type, and size. The storage region types include, but are not limited to, one or more of the following: hash table (BPF_MAP_TYPE_HASH), array (BPF_MAP_TYPE_ARRAY), and counters (BPF_MAP_TYPE_PERCPU_ARRAY and BPF_MAP_TYPE_PERF_EVENT_ARRAY). As an example, different types of BPF Maps are suitable for different scenarios, and the appropriate type can be selected based on the actual situation. For example, hash table is the most commonly used BPF Map type. Hash table and array-type BPF Maps are used to store key-value pairs, while counter-type BPF Maps are used to implement various statistical functions.
[0051] Specifically, the above provides an eBPF program, which includes the following operations: compiling eBPF program code (e.g., jvm_speed_up_memory_access_ebpf) that can monitor the memory space of the Java Virtual Machine, and compiling the eBPF program into bytecode using a compiler; loading the eBPF program into the kernel using a loading tool; and mounting the eBPF program under the kernel using a calling tool to monitor and track execution events or function calls under the kernel. As mentioned above, eBPF programs need to implement memory mapping between the application layer and the kernel. Therefore, after being loaded into the kernel, they also need to be mounted to the application layer. For example, a loading tool (such as bpftool or other tools) can be used to load the eBPF program (e.g., jvm_speed_up_memory_access_ebpf) into the kernel. The eBPF program can then be mounted into the system calls in the kernel by calling tools (e.g., iproute2 tool, BPF system call tool, bpftool command line tool, or kernel module tool). Preferably, in some other embodiments, in addition to mounting the eBPF program into the system calls in the kernel, the eBPF program can also be mounted into Tracepoint or Uprobe to achieve the above-mentioned monitoring of kernel execution time or application layer function calls.
[0052] It should also be noted that after providing an eBPF program, the process also includes checking the running status of the eBPF program. Specifically, this involves checking whether the eBPF program (e.g., jvm_speed_up_memory_access_ebpf) is running normally, including but not limited to whether it can be called normally and whether it has the necessary calling permissions. This can be tested according to the actual scenario.
[0053] In the above implementation, since the loading and operation of the eBPF program are both performed in the kernel, some / all of the kernel-level memory data can be directly copied. The memory data under the application layer can be mapped to the storage area through the native access interface and native method interface in the native library of the Java Virtual Machine. As an example, the native library (e.g., Java Native Access (JNA)), native access interface (e.g., JNI (Java Native Interface)), and native method interface (e.g., NMI (Native Method Interface)) provided by the Java Virtual Machine can be used to map the memory data of Java objects, thread stacks, native method stacks, etc. in the Java Virtual Machine user space to the BPF Map. Based on the eBPF program and BPF Map compiled above, when memory (kernel / application layer) copying occurs, the memory data of Java objects, thread stacks, and native method stacks are mapped to the BPF Map. In the eBPF program, the data in the BPF Map is manipulated through functions such as bpf_map_update_elem().
[0054] S20: The application issues an operation instruction to operate on memory data, and the Java Virtual Machine calls the native method interface to the memory space;
[0055] In this embodiment, the aforementioned operation instructions include, but are not limited to, reading, copying, writing, updating, and deleting memory data. The application calls the eBPF program and executes the operation instructions through the application programming interface (API) function to read, write, update, or delete the corresponding memory data; and obtains the kernel-level memory data through the storage area. All Java Virtual Machine (JVM) calls to the memory space are application-layer operations, and this memory space is the JVM runtime data area. Native memory data calls are implemented by calling the native access interface in the JVM's native library. The native access interface passes the function call to the native method interface inside the JVM, and the native method interface passes the function call to the eBPF program. Based on the foregoing, specifically, as an example and not a limitation, a Java program (e.g., java_speed_up_memory_access_java.java) is configured to call the native access interface (e.g., JNI) in the JVM's native library (e.g., JNA (Java Native Access)) to implement native calls. The native access interface passes function calls to the native method interface (e.g., NMI) inside the Java Virtual Machine, and passes operation instructions containing the memory addresses of the Java object, thread stack, and native method stack to the native method interface. The native method interface maps the aforementioned calls to the function library of the native system, thereby realizing the interaction between the Java application and the native system. In some embodiments, the native method interface passing function calls to the eBPF program includes: the native method interface passing native memory data to a dynamic link library, and the dynamic link library passing the function calls to the eBPF program. At the application layer, the interaction between the application and the native system (memory space) is implemented through the Java Virtual Machine. In the native system, the dynamic link library passes function calls to the aforementioned eBPF program (e.g., jvm_speed_up_memory_access_ebpf). For example, native memory data is passed to the dynamic link library through the native method interface (e.g., NMI), and then the function calls are passed to the eBPF program through the dynamic link library, thereby realizing the native method interface passing function calls to the eBPF program. eBPF programs use BPF Maps to read and write memory of Java applications within the kernel. The eBPF program returns the result to the dynamic link library, which then passes it to the native method interface (e.g., NMI).The native method interface returns the result to the JNI (Java Native Interface) method inside the Java Virtual Machine. User-mode and kernel memory data sharing is achieved through eBPF programs. By mapping some / all memory data to BPF Maps, applications can directly access shared memory, avoiding the overhead of copying and synchronization. BPF Maps can perform data lookup in O(1) time, which is very useful for applications that need to quickly find data. eBPF provides a set of simple and easy-to-use APIs, making it convenient to use BPF Maps technology to implement shared memory access. eBPF runs in the kernel, ensuring the security and reliability of memory access. This implementation optimizes the Java Virtual Machine based on eBPF programs, reducing the complexity of writing code and solving the problems of complex operation and high resource consumption in existing Java Virtual Machine memory access acceleration methods. The memory access method provided in this implementation does not require memory copying between user-mode and kernel-mode memory, improving performance.
[0056] S30: The eBPF program returns the execution result to the memory space of the Java Virtual Machine through the mapping of the storage area;
[0057] Specifically, it should be noted that the operations performed in the eBPF program are carried out in the kernel. These operations are executed through application programming interface (API) functions to read, write, update, or delete corresponding memory data. In the eBPF program, data in the BPF Maps is accessed through API functions (such as bpf_map_lookup_elem()): this includes reading, writing, updating, and deleting. Commonly used API functions include bpf_map_lookup_elem(): finding an element in the BPF Map by key; bpf_map_update_elem(): inserting or updating an element in the BPF Map; and bpf_map_delete_elem(): deleting an element from the BPF Map. These API functions access and manipulate the application-layer and kernel (shared) memory data in the BPF Maps.
[0058] S40: The application obtains the execution result of the operation instruction by accessing the memory space of the Java Virtual Machine.
[0059] In this implementation, the aforementioned operations on memory data are executed under the kernel and then returned to the Java Virtual Machine's internal native access interface (e.g., JNI (Java Native Interface)). The native access interface returns the results to the application, meaning the application directly obtains the execution results at the application layer without waiting for kernel operation feedback. This can be viewed as the application directly copying the execution results through the eBPF program. The application can directly access the shared memory between the user layer and the kernel without copying memory between user space and kernel space, thus improving memory access speed.
[0060] In a preferred embodiment, kernel memory data can also be directly obtained through the eBPF program described above without copying. For example, if an application calls the eBPF program to obtain kernel memory data through the storage area, that is, a Java application is written, such as java_speed_up_memory_access_java.java, which calls the eBPF program to realize direct operation on kernel memory at the application layer.
[0061] Furthermore, in another preferred embodiment, after directly obtaining the kernel-level memory data at the application layer, data processing can also be performed directly at the application layer. Specifically, in the Java Virtual Machine, memory data in the storage area can be obtained through the native method interface, and the memory data in the memory space can be adjusted by accessing the system native library through the dynamic link library. That is, in the Java Virtual Machine, the modified value is written back to the corresponding user space memory (i.e., the same memory space) through the native library (e.g., JNA), so as to achieve performance optimization of Java objects, thread stacks, and native method stacks, reduce the switching overhead from user mode to kernel mode, and realize the use of shared memory.
[0062] Example 2: This example also provides a Java Virtual Machine memory access system 5 based on eBPF, see [link / reference]. Figure 2 This includes the application layer 51, the kernel 52, and a pre-provided eBPF program 53, specifically:
[0063] The eBPF program is configured to include a storage area for kernel-level memory data; the eBPF program monitors the memory space of the Java Virtual Machine under the application layer to map the application-level memory data to the storage area, wherein the memory data includes objects, thread stacks, and native method stacks;
[0064] As an explanation, eBPF programs need to implement memory mapping between the application layer and the kernel. Therefore, after the kernel is loaded, it is necessary to mount it to the application layer. The eBPF program copies part or all of the memory data under the kernel and can also map the memory data under the application layer, realizing the sharing of memory data between the application layer and the kernel. When the application layer needs memory data under the kernel, it can obtain it directly from this storage area. The eBPF program can perform operations under the kernel. Therefore, the processing of memory data can be carried out under the kernel without having to access it through the application layer and then have the kernel process and return it, thus effectively increasing the memory access speed of the Java Virtual Machine.
[0065] Application layer: Receives an operation instruction from the application that operates on memory data; the Java Virtual Machine calls the native method interface to the memory space; the application obtains the execution result of the operation instruction by accessing the Java Virtual Machine's memory space.
[0066] For illustrative purposes, the above operation instructions include, but are not limited to, reading, copying, writing, updating, and deleting memory data. All Java Virtual Machine (JVM) calls to memory space are application-layer operations. Applications implement native calls through native access interfaces (e.g., JNI) in native libraries (e.g., JNA (Java Native Access)) within the JVM, and pass operation instructions containing the memory addresses of the Java objects, thread stacks, and native method stacks to the native method interface (e.g., NMI (Native Method Interface)). Then, the operation results of the corresponding instructions are obtained through the kernel operations of the eBPF program described below.
[0067] Kernel layer: The eBPF program obtains the operation instructions through the mapping of storage areas and executes them under the kernel, returning the execution results to the memory space of the Java Virtual Machine.
[0068] As an explanation, the above-mentioned execution in the eBPF program takes place in the kernel. The operation instructions are executed through the application programming interface function to read, write, update or delete the corresponding memory data. The operation results are directly returned to the memory space of the Java Virtual Machine, so that the application can directly obtain the execution results at the application layer without waiting for kernel operation feedback. This can be regarded as directly reading the execution results based on the storage area address, improving memory access speed, and is convenient to operate without occupying system resources.
[0069] In this embodiment, preferably, the eBPF program described above can also directly obtain kernel-level memory data for application-level processing. Specifically, at the application layer, memory data in the storage area of the eBPF program is obtained through the native method interface in the Java Virtual Machine, and the data in the memory space is adjusted by dynamically accessing the system's native libraries. This adjustment may include reading, writing, updating, or deleting as described above. It should be noted that this adjustment only needs to involve reading kernel-level memory data. When it is necessary to change kernel-level memory data, the eBPF program needs to be called to perform the operation in the kernel as described above.
[0070] This embodiment provides a Java Virtual Machine memory access system based on eBPF. It copies part or all of the kernel memory data through an eBPF program and can simultaneously map the application layer memory data, realizing memory data sharing between the application layer and kernel memory. This reduces memory copying in the Java Virtual Machine, accelerates Java Virtual Machine memory access speed, and enables fast data lookup without the need for memory copying between user space and kernel space, thus reducing system resource consumption.
[0071] It should be noted that the embodiments of the present invention have better implementability and are not intended to limit the present invention in any way. Any person skilled in the art may use the above-disclosed technical content to change or modify it into equivalent effective embodiments. However, any modifications or equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of the technical solution of the present invention.
Claims
1. A Java Virtual Machine memory access method based on eBPF, characterized in that, include: An eBPF program is provided in advance, which configures a storage area including kernel-level memory data; The eBPF program monitors the memory space of the Java Virtual Machine under the application layer to map the memory data under the application layer to the storage area; The application issues operation instructions that operate on memory data, and calls native method interfaces to memory space through the Java Virtual Machine; The eBPF program obtains the operation instructions through the mapping of the storage area and executes them under the kernel, returning the execution result to the memory space of the Java Virtual Machine; The application obtains the execution result of the operation instruction by accessing the memory space of the Java Virtual Machine; wherein, the step of calling the native method interface to the memory space through the Java Virtual Machine includes: By calling the native access interface in the native library of the Java Virtual Machine, local access to memory data is achieved. The native access interface passes the function call to the native method interface inside the Java Virtual Machine, and the native method interface passes the function call to the eBPF program. The native method interface passes the function call to the eBPF program in the following ways: The native method interface passes the memory data to the dynamic link library, and the dynamic link library passes the function call to the eBPF program. The interaction between the application and the native system is realized through the Java Virtual Machine at the application layer. In the native system, the dynamic link library passes the function call to the eBPF program. The provision of an eBPF program includes: Compile an eBPF program that can monitor the memory space of the Java Virtual Machine, and compile the eBPF program into eBPF bytecode using a compiler; The eBPF program is loaded into the kernel using a loading tool; The eBPF program is mounted to the kernel by calling tools to monitor and track execution events or function calls under the kernel. The eBPF program is also mounted to Tracepoint and Uprobe to monitor kernel execution time or application layer function calls.
2. The access method according to claim 1, characterized in that: The memory data includes objects, thread stacks, and native method stacks.
3. The access method according to claim 1, characterized in that, After providing an eBPF program, it also includes: Check the running status of the eBPF program.
4. The access method according to claim 1, wherein the application issues operation instructions acting on memory data, including: The application calls the eBPF program and executes the operation instructions through the application interface function to read, write, update or delete the corresponding memory data; The kernel memory data is obtained through the storage area.
5. The access method according to claim 1, characterized in that: A storage region is configured by defining the storage region type, storage region key type, value type, and storage region size; wherein, the storage region type includes any one or more of the following: hash table, array, counter.
6. A Java Virtual Machine memory access system based on eBPF, characterized in that: It includes the application layer, the kernel, and a pre-provided eBPF program, which configures a storage area including kernel-level memory data; The eBPF program monitors the memory space of the Java Virtual Machine under the application layer to map the memory data under the application layer to the storage area; Application layer: The application issues operation instructions that act on the memory data, and calls native method interfaces to the memory space through the Java Virtual Machine; the application obtains the execution result of the operation instructions by accessing the memory space of the Java Virtual Machine; Kernel layer: The eBPF program obtains the operation instructions through the mapping of storage areas and executes them under the kernel, returning the execution results to the memory space of the Java Virtual Machine; This includes calling native method interfaces into memory space via the Java Virtual Machine, including: By calling the native access interface in the native library of the Java Virtual Machine, local access to memory data is achieved. The native access interface passes the function call to the native method interface inside the Java Virtual Machine, and the native method interface passes the function call to the eBPF program. The native method interface passes the function call to the eBPF program in the following ways: The native method interface passes the memory data to the dynamic link library, and the dynamic link library passes the function call to the eBPF program. The interaction between the application and the native system is realized through the Java Virtual Machine at the application layer. In the native system, the dynamic link library passes the function call to the eBPF program. The provision of an eBPF program includes: Compile an eBPF program that can monitor the memory space of the Java Virtual Machine, and compile the eBPF program into eBPF bytecode using a compiler; The eBPF program is loaded into the kernel using a loading tool; The eBPF program is mounted to the kernel by calling tools to monitor and track execution events or function calls under the kernel. The eBPF program is also mounted to Tracepoint and Uprobe to monitor kernel execution time or application layer function calls.
7. The access system according to claim 6, characterized in that: At the application layer, memory data in the storage area of the eBPF program is obtained through the native method interface in the Java Virtual Machine, and the data in the memory space is adjusted by dynamically accessing the system native library.
Citation Information
Patent Citations
Virtual machine kernel monitoring method and device, equipment and storage medium
CN114816668A
Data processing method and system
CN116107764A