# oracle/visualvm architecture

> Architecture diagram of the GitHub repository oracle/visualvm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oracle/visualvm
- Repository: https://github.com/oracle/visualvm

## Overview

##### Project type and purpose
- This is a desktop, modular Java application built on the NetBeans Platform. Its purpose is to provide VisualVM, a GUI wrapper around JDK command-line tools (JMX, jstat, jstack, JFR, JVMTI, etc.) with profiling, heap/CPU/threads monitoring and extensibility via plugins.

##### File‐tree architecture overview
- Top‐level directories:
- integrations/… – IDE integrations (Eclipse, VSCode)
- plugins/…      – VisualVM plugin suite
- visualvm/…     – core VisualVM suite (NetBeans modules)
- samples/, templates/ – example modules
- Key modules under visualvm/visualvm:
- core/           – bootstrap and module system
- appui/          – platform UI support
- application/    – “Applications” data source
- jmx/, jvmstat/  – JMX and JVM metrics providers
- heapdump/, threaddump/, coredump/, jfr/ – snapshot providers
- charts/, caching.api/ – support libraries
- profiler/, sampler/, tracer/ – profiling subsystems

##### Reading the README
- Two suites:
- visualvm/visualvm – core tool built with Ant against NetBeans Platform 22
- visualvm/plugins   – plugin suite that loads atop the core distribution
- Build/run commands and dependency on NetBeans platform structure.

##### Diagramming guidance
- NetBeans Platform Runtime
- Core VisualVM modules (core, caching.api, charts)
- DataSource Providers (application, host, JMX, jstat, JVMTI, JFR, heapdump, threaddump, coredump)
- Profiling Engines (profiler, sampler, tracer)
- UI Viewer modules (applicationviews, heapviewer, jfr views, profiler views)
- Plugin loader and individual plugins (under plugins/)
- External services/tools (JDK tools, native libs, BTrace)
- IDE integrations (Eclipse, VSCode extensions)

- User action → UI Viewer → Model API → DataSource Provider → JDK/JVM APIs/native
- Data flows back → Model → UI
- Plugins register via NetBeans Lookup/Services to extend modules or views
- IDE integrations invoke VisualVM via wrapper & pass args

c. Architectural patterns:
- Modular plugin architecture (NetBeans modules with manifest, layer.xml)
- MVC: UI Viewer modules separate from DataSource and Model layers
- Service Locator (Lookup API) for extensibility

d. Technologies & frameworks:
- Java 8 on Oracle JDK 8
- Apache Ant 1.9.15 build scripts
- NetBeans Platform 22
- JMX, JVMTI, JFR, native profiling APIs, BTrace
- VSCode & Eclipse extension APIs for IDE integrations

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Platform Layer"
        NBPR["NetBeans Platform Runtime"]:::blue
    end

    subgraph "Core VisualVM Modules"
        CORE["core"]:::blue
        CACHE["caching.api"]:::blue
        CHARTS["charts"]:::blue
    end

    subgraph "DataSource & Profiling Modules"
        subgraph "DataSource Providers"
            APP["Applications"]:::green
            HOST["Hosts (Local/Remote)"]:::green
            JMX["JMX"]:::green
            JVMSTAT["JVM Metrics (jvmstat)"]:::green
            JVMTI["JVMTI-based"]:::green
            JFR["JFR"]:::green
            HEAP["Heap dumps"]:::green
            THREAD["Thread dumps"]:::green
            CCORE["Core dumps"]:::green
        end
        subgraph "Profiling Engines"
            PROF["Profiler"]:::green
            SAMPLER["Sampler"]:::green
            TRACER["Tracer"]:::green
        end
    end

    subgraph "UI Viewer Modules"
        APPV["Application Views"]:::orange
        HEAPV["Heap Viewer"]:::orange
        JFRV["JFR Views"]:::orange
        PROFV["Profiler Views"]:::orange
    end

    subgraph "Plugin System"
        PLUGINLOADER["Plugin Loader & Importer"]:::yellow
        subgraph "Plugin Suite"
            BTRACE["btrace"]:::yellow
            BUFM["buffermonitor"]:::yellow
            CONSUMER["consumerentrypoints"]:::yellow
        end
    end

    subgraph "IDE Integrations"
        ECLIPSE["Eclipse Integration"]:::yellow
        VSCODE["VSCode Integration"]:::yellow
    end

    subgraph "External Services / Tools"
        JDKTOOLS["JDK Tools (jstat, jstack, JFR)"]:::gray
        NATIVELIB["Native Profiling APIs & BTrace"]:::gray
    end

    NBPR --> CORE
    CORE --> CACHE
    CORE --> CHARTS

    CORE --> APP
    CORE --> HOST
    CORE --> JMX
    CORE --> JVMSTAT
    CORE --> JVMTI
    CORE --> JFR
    CORE --> HEAP
    CORE --> THREAD
    CORE --> CCORE
    CORE --> PROF
    CORE --> SAMPLER
    CORE --> TRACER

    APPV --> APP
    HEAPV --> HEAP
    JFRV --> JFR
    PROFV --> PROF

    APP --> JDKTOOLS
    HOST --> JDKTOOLS
    JMX --> JDKTOOLS
    JVMSTAT --> JDKTOOLS
    JVMTI --> NATIVELIB
    JFR --> NATIVELIB
    HEAP --> NATIVELIB
    THREAD --> NATIVELIB
    CCORE --> NATIVELIB
    PROF --> NATIVELIB
    SAMPLER --> NATIVELIB
    TRACER --> NATIVELIB

    PLUGINLOADER --> CORE
    PLUGINLOADER --> APPV
    PLUGINLOADER --> HEAPV
    PLUGINLOADER --> JFRV
    PLUGINLOADER --> PROFV

    BTRACE --> PLUGINLOADER
    BUFM --> PLUGINLOADER
    CONSUMER --> PLUGINLOADER

    ECLIPSE --> NBPR
    VSCODE --> NBPR

    classDef blue fill:#bbdefb,stroke:#1e88e5;
    classDef green fill:#c8e6c9,stroke:#43a047;
    classDef orange fill:#ffe0b2,stroke:#fb8c00;
    classDef yellow fill:#fff9c4,stroke:#fbc02d,stroke-dasharray: 3 3;
    classDef gray fill:#eceff1,stroke:#546e7a;

    click NBPR "https://github.com/oracle/visualvm/tree/master/visualvm/branding"
    click CORE "https://github.com/oracle/visualvm/tree/master/visualvm/core"
    click CACHE "https://github.com/oracle/visualvm/blob/master/visualvm/caching.api"
    click CHARTS "https://github.com/oracle/visualvm/tree/master/visualvm/charts"
    click APP "https://github.com/oracle/visualvm/tree/master/visualvm/application"
    click HOST "https://github.com/oracle/visualvm/tree/master/visualvm/host"
    click JMX "https://github.com/oracle/visualvm/tree/master/visualvm/jmx"
    click JVMSTAT "https://github.com/oracle/visualvm/tree/master/visualvm/jvmstat"
    click JVMTI "https://github.com/oracle/visualvm/tree/master/visualvm/jvm"
    click JFR "https://github.com/oracle/visualvm/tree/master/visualvm/jfr"
    click HEAP "https://github.com/oracle/visualvm/tree/master/visualvm/heapdump"
    click THREAD "https://github.com/oracle/visualvm/tree/master/visualvm/threaddump"
    click CCORE "https://github.com/oracle/visualvm/tree/master/visualvm/coredump"
    click PROF "https://github.com/oracle/visualvm/tree/master/visualvm/profiler"
    click SAMPLER "https://github.com/oracle/visualvm/tree/master/visualvm/sampler"
    click TRACER "https://github.com/oracle/visualvm/tree/master/visualvm/tracer"
    click APPV "https://github.com/oracle/visualvm/tree/master/visualvm/applicationviews"
    click HEAPV "https://github.com/oracle/visualvm/tree/master/visualvm/heapviewer"
    click JFRV "https://github.com/oracle/visualvm/tree/master/visualvm/jfr/src/org/graalvm/visualvm/jfr/view"
    click PROFV "https://github.com/oracle/visualvm/tree/master/visualvm/profiler/src"
    click PLUGINLOADER "https://github.com/oracle/visualvm/tree/master/visualvm/pluginimporter"
    click BTRACE "https://github.com/oracle/visualvm/tree/master/plugins/btrace"
    click BUFM "https://github.com/oracle/visualvm/tree/master/plugins/buffermonitor"
    click CONSUMER "https://github.com/oracle/visualvm/tree/master/plugins/consumerentrypoints"
    click ECLIPSE "https://github.com/oracle/visualvm/tree/master/integrations/eclipse"
    click VSCODE "https://github.com/oracle/visualvm/tree/master/integrations/vscode"
```
