Skip to content

pushkar0406/JvmDescriptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

JVM Monitor - Real-time Process Monitoring Dashboard

A comprehensive real-time monitoring system for JVM processes with a Spring Boot backend and Angular frontend. Monitor running JVM processes, threads, loaded classes, object instances, and memory usage through a beautiful, modern dashboard.

🌟 Features

  • Process Discovery: Automatically detect and list all running JVM processes
  • Thread Monitoring: View all threads with state, stack traces, and statistics
  • Class Explorer: Browse loaded classes with search and filtering
  • Object Statistics: Analyze object instances and memory usage
  • Real-time Updates: WebSocket-based live updates every 2 seconds
  • Modern UI: Dark theme with glassmorphism effects and smooth animations

πŸ—οΈ Architecture

Backend (Spring Boot)

  • JVM Monitoring: Uses Java Attach API and JMX to connect to running JVM processes
  • REST API: Endpoints for processes, threads, classes, objects, and memory
  • WebSocket: STOMP over SockJS for real-time monitoring updates
  • Technologies: Spring Boot 2.0.9, Java 8, Maven

Frontend (Angular)

  • Dashboard: Responsive grid layout with 5 main components
  • Real-time: WebSocket integration for live data updates
  • Modern Design: Dark theme with vibrant purple/blue gradients
  • Technologies: Angular 6.2.9, TypeScript, RxJS, SockJS, STOMP

πŸ“‹ Prerequisites

  • JDK 8 (not JRE) - Required for tools.jar and Attach API
  • Node.js 8.12.0 and npm
  • Angular CLI 6.2.9
  • Maven 3.x

πŸš€ Quick Start

Backend Setup

cd backend
mvn clean install
mvn spring-boot:run

The backend will start on http://localhost:8080

Frontend Setup

cd frontend
npm install
ng serve

The frontend will be available at http://localhost:4200

πŸ“‘ API Endpoints

REST API

  • GET /api/processes - List all JVM processes
  • GET /api/processes/{pid}/threads - Get threads for a process
  • GET /api/processes/{pid}/classes - Get loaded classes
  • GET /api/processes/{pid}/objects - Get object statistics
  • GET /api/processes/{pid}/memory - Get memory information
  • GET /api/health - Health check

WebSocket

  • Endpoint: ws://localhost:8080/ws
  • Topics:
    • /topic/monitoring - Real-time process monitoring updates
    • /topic/processes - Process list updates

🎨 UI Components

  1. Process List: Grid of cards showing all running JVM processes with PID, name, memory usage, uptime, thread count, and class count
  2. Metrics Panel: Real-time metrics showing heap memory, non-heap memory, active threads, and GC statistics
  3. Thread Viewer: List of threads with state filtering, expandable stack traces, and real-time updates
  4. Class Explorer: Searchable table of loaded classes with package information and instance counts
  5. Object Viewer: Sortable table of object statistics with memory usage and heap percentage

πŸ”§ Configuration

Backend Configuration

Edit backend/src/main/resources/application.properties:

server.port=8080
spring.websocket.allowed-origins=http://localhost:4200

Frontend Configuration

Edit frontend/src/environments/environment.ts:

export const environment = {
  production: false,
  apiUrl: 'http://localhost:8080/api',
  wsUrl: 'http://localhost:8080/ws'
};

⚠️ Important Notes

JDK Requirement

This application requires JDK (not JRE) because it uses tools.jar for the Java Attach API. Make sure JAVA_HOME points to your JDK installation.

Permissions

The monitoring application needs to run with the same user permissions as the JVM processes you want to monitor. Some processes may not be accessible if running under different users.

Performance

  • Object instance tracking can be memory-intensive
  • Real-time updates are sent every 2 seconds for selected process
  • Process list updates every 5 seconds

πŸ› Troubleshooting

Backend won't start

  • Ensure you're using JDK 8 (not JRE)
  • Check that tools.jar exists in $JAVA_HOME/lib/
  • Verify port 8080 is not in use

Frontend build errors

  • Run npm install to ensure all dependencies are installed
  • Check Node.js version: node --version (should be 8.12.0)
  • Check Angular CLI version: ng --version (should be 6.2.9)

WebSocket connection fails

  • Ensure backend is running on port 8080
  • Check CORS configuration in CorsConfig.java
  • Verify firewall settings

No processes detected

  • Ensure you're running with appropriate permissions
  • Check that other JVM processes are actually running
  • Verify JDK is properly installed

πŸ“š Technology Stack

Backend:

  • Spring Boot 2.0.9
  • Spring WebSocket
  • Java Attach API
  • JMX (Java Management Extensions)
  • Maven

Frontend:

  • Angular 6.2.9
  • TypeScript 2.9.2
  • RxJS 6.2.2
  • SockJS Client
  • STOMP.js

πŸ“„ License

This project is created for JVM monitoring and debugging purposes.

🀝 Contributing

Feel free to submit issues and enhancement requests!


Built with ❀️ using Spring Boot and Angular

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors