Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nenuadrian authored Nov 25, 2024
1 parent 18c6f52 commit afae5c2
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,45 @@
# BSc Dissertation Project - University of Manchester - Non-intrusive JVM agents for capturing the internal state of live production applications
# BSc Dissertation Project - University of Manchester - Non-intrusive JVM agents for capturing the internal state of live production applications

[![CMake on a single platform](https://github.com/nenuadrian/c-java-native-interface-agent-stack-trace-heap-capture/actions/workflows/cmake-single-platform.yml/badge.svg)](https://github.com/nenuadrian/c-java-native-interface-agent-stack-trace-heap-capture/actions/workflows/cmake-single-platform.yml)
[![LaTeX Build](https://github.com/nenuadrian/bsc-dissertation-c-java-native-interface-agent-stack-trace-heap-capture/actions/workflows/main.yml/badge.svg)](https://github.com/nenuadrian/bsc-dissertation-c-java-native-interface-agent-stack-trace-heap-capture/actions/workflows/main.yml)

## Overview
This repository contains the implementation of a C JNI Agent designed to recursively capture the values of objects within methods on a stack trace.

![design](DISSERTATION/end-design.png)

## Prerequisites
To utilize this agent, you need to install the following libraries:
- `libxml2`
- `crypto`
- `openssl`
This project implements a non-intrusive JVM agent capable of capturing the internal state of live production applications. The agent is written in C and utilizes the Java Native Interface (JNI) to interact with the Java Virtual Machine (JVM). It recursively captures the values of objects within methods on a stack trace, providing valuable debugging information without impacting application performance. [cite: 23, 24, 25, 55, 56, 57]

## Installation and Usage
1. **Building the JNI Agent**:
Compile the JNI agent and generate the library files.

2. **Running with Java**:
Incorporate the resulting library files using the Java command's `-agentpath` flag.
![design](DISSERTATION/end-design.png)

## Scala Spray Server Integration
This agent interfaces with a basic Scala Spray server to record captured values in MongoDB.
## Key Features

### Configuration
- Modify the `src/main/resources/application.conf` file to configure the server settings.
- Build and run the server using `sbt run`.
* **Non-intrusive:** The agent operates independently of the JVM, minimizing performance overhead and avoiding any interference with the application's normal execution.
* **Cross-Platform Compatibility:** The agent is designed to be compatible with various operating systems, including macOS, Windows, and Linux.
* **Recursive Object Capture:** The agent can recursively capture the values of objects on the heap, providing a comprehensive snapshot of the application's state at the time of an exception.
* **Efficient Data Handling:** The agent employs data compression techniques to reduce the amount of data transmitted and stored, improving efficiency and minimizing resource usage.

## FuelPHP Dashboard
## Technologies Used

![dashboard](DISSERTATION/dashboard-app.png)
* **JNI (Java Native Interface):** Enables the C agent to interact with the JVM and access its internal state.
* **JVMTI (JVM Tool Interface):** Provides additional capabilities for monitoring and debugging the JVM.
* **Scala:** Used to implement the API server, which handles data communication between the agent and the dashboard.
* **Spray:** A Scala library used for building RESTful APIs, facilitating communication between the agent and the dashboard.
* **MongoDB:** A NoSQL database used for storing the captured data.
* **FuelPHP:** A PHP framework used to develop the dashboard for visualizing and exploring the captured data.
* **Miniz:** A data compression library used to optimize data transfer and storage.
* **OpenSSL:** A cryptography library used for data encryption and security.

A FuelPHP dashboard displays the analysis results by communicating with the Scala Spray server.
## Installation and Usage

### Setup
- Perform `composer install` to set up the FuelPHP dashboard.
Refer to the project's README for detailed instructions on building and deploying the agent, API server, and dashboard.

## Note
This implementation serves as a Minimum Viable Product (MVP). It is not stable, secure, or optimized. However, relevant code snippets can be extracted and used, especially those demonstrating communication with the JNI.

This implementation is a Minimum Viable Product (MVP) and is not intended for production use without further development and hardening.

## Disclaimer
This was academic research, and no guarantees or maintenance are provided.

# Cite
This project was developed as part of academic research. No guarantees or maintenance are provided.

## Cite

```
@article{jniAgents,
Expand Down

0 comments on commit afae5c2

Please sign in to comment.