DEV.co
Open-Source Observability · LinShunKang

MyPerf4J

MyPerf4J is a Java application performance monitoring (APM) tool that uses bytecode instrumentation via JavaAgent to monitor method execution times and JVM metrics without modifying application code. It claims to support 16 million operations per second with minimal memory overhead and 1-second monitoring granularity.

Source: GitHub — github.com/LinShunKang/MyPerf4J
3.6k
GitHub stars
556
Forks
Java
Primary language
BSD-3-Clause
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryLinShunKang/MyPerf4J
OwnerLinShunKang
Primary languageJava
LicenseBSD-3-Clause — OSI-approved
Stars3.6k
Forks556
Open issues7
Latest release3.6.0 (2025-11-16)
Last updated2026-07-08
Sourcehttps://github.com/LinShunKang/MyPerf4J

What MyPerf4J is

MyPerf4J operates as a JavaAgent that instruments Java bytecode using ASM to capture method-level latency metrics (RPS, percentiles TP50–TP9999, min/max/avg/stddev), JVM thread/memory/GC metrics, and outputs results to log files. The tool stores metrics in memory with object reuse, exports to InfluxDB for visualization, and requires JVM parameter configuration at startup.

Quickstart

Get the MyPerf4J source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/LinShunKang/MyPerf4J.gitcd MyPerf4J# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Identifying performance bottlenecks in high-concurrency microservices

MyPerf4J is designed for low-latency, high-throughput systems; the per-method latency breakdown (with percentiles down to TP9999) helps pinpoint slow services or methods under production load.

Real-time operational monitoring with minimal application disruption

As a non-invasive JavaAgent requiring no code changes, it suits teams needing instant deployment of monitoring into existing monolithic or microservice Java applications without rebuild cycles.

Troubleshooting JVM resource contention and GC pressure

Capture thread count, memory heap/non-heap, GC events, and class loading metrics in real-time; correlate with method metrics to diagnose whether slowdown is due to business logic or JVM resource starvation.

Implementation considerations

  • Requires JVM parameter injection at startup (-javaagent and -DMyPerf4JPropFile); cannot be attached or detached at runtime without restart.
  • Configuration via MyPerf4J.properties file; must define app_name, metrics log location, and filter.packages.include to specify which classes to instrument.
  • Outputs metrics to log files by default; InfluxDB integration requires manual setup (dashboards linked in README but configuration steps not fully detailed in provided excerpt).
  • JDK 9+ requires additional flag --add-opens java.base/java.lang=ALL-UNNAMED; verify compatibility with your JDK and application module configuration.
  • Memory footprint minimal per claims, but actual heap/CPU overhead impact depends on number of instrumented methods and monitoring interval; load-testing recommended before production deployment.

When to avoid it — and what to weigh

  • Distributed tracing across services is required — MyPerf4J captures per-JVM metrics and method-level latency but does not provide cross-service request tracing, correlation IDs, or integration with standard distributed tracing backends (e.g., Jaeger, Zipkin).
  • Custom metric definitions or high-cardinality tag-based filtering — The tool offers a fixed set of metrics (method latency percentiles, JVM stats); if you need application-specific counters, gauges, or dynamic tag-based filtering, extensibility is unclear from the data.
  • Strict data governance or on-premise observability stack with proprietary tooling — Metrics are exported to files and InfluxDB; if your organization requires direct integration with commercial APM platforms (New Relic, Datadog, AppDynamics) or air-gapped infrastructure, feasibility is Unknown.
  • Support for non-JVM languages or polyglot monitoring — MyPerf4J is Java-only. Multi-language or polyglot infrastructure will require separate monitoring solutions.

License & commercial use

Licensed under BSD-3-Clause (BSD 3-Clause 'New' or 'Revised' License), a permissive OSI-approved license allowing commercial use, modification, and distribution with attribution and liability disclaimer.

BSD-3-Clause is a permissive OSI license that permits commercial use without restriction. However, integration with proprietary systems, long-term support, and commercial indemnification are not addressed in the license. Consult internal compliance review before deploying in mission-critical production systems.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

MyPerf4J instruments bytecode at runtime using ASM and requires -javaagent privilege. No disclosure of security audit, threat model, or vulnerability handling process in provided data. Consider: (1) Does instrumentation of sensitive method signatures leak confidential data to log files? (2) Are log files encrypted or access-controlled? (3) Is bytecode transformation vetted against bytecode injection attacks? Requires security review before use in regulated environments.

Alternatives to consider

Datadog APM Agent (Java)

Proprietary; provides distributed tracing, auto-instrumentation, third-party library support, and managed platform with compliance certifications. Easier out-of-box integration but comes with SaaS cost and vendor lock-in.

Elastic APM Java Agent

Open-source APM agent with distributed tracing, custom metrics, and integration into Elastic Stack (ELK). Offers more observability depth than MyPerf4J but requires separate infrastructure and more operational overhead.

Java Flight Recorder (JFR) + Mission Control

Built into modern JDK; low-overhead, production-safe profiling with detailed CPU, memory, and I/O events. No third-party dependency but lacks method-level percentile aggregation and real-time dashboard by default.

Software development agency

Build on MyPerf4J with DEV.co software developers

MyPerf4J offers lightweight, non-invasive APM for Java microservices and monoliths. Before production deployment, verify integration with your observability backend (InfluxDB, Grafana, or ELK), conduct load testing to measure overhead, and review security implications of bytecode instrumentation. Consult Devco if you need guidance on integration, deployment, or alternative APM solutions.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

MyPerf4J FAQ

Can MyPerf4J be attached to a running JVM without restart?
No. MyPerf4J operates as a JavaAgent and must be configured at JVM startup via -javaagent parameter. Attachment at runtime is not documented; removal requires restart.
What is the performance overhead of instrumentation?
README claims 63 nanoseconds per metric recording on a single thread handling 16 million ops/sec. Actual overhead on production workloads depends on instrumented method count and GC impact; load-test your specific application.
Does MyPerf4J support distributed tracing or service-to-service correlation?
Not documented. MyPerf4J captures per-JVM method latency and JVM metrics; cross-service request tracing requires manual integration with a distributed tracing system (e.g., Jaeger). Feasibility is Unknown.
Is MyPerf4J suitable for production use in regulated industries?
Requires security and compliance review. No SLA, commercial support, or security audit data provided. BSD license does not include indemnification. Assess risk based on your organization's policies before production deployment.

Custom software development services

Need help beyond evaluating MyPerf4J? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source observability integrations — and maintain them long-term.

Evaluate MyPerf4J for Your Java Observability Stack

MyPerf4J offers lightweight, non-invasive APM for Java microservices and monoliths. Before production deployment, verify integration with your observability backend (InfluxDB, Grafana, or ELK), conduct load testing to measure overhead, and review security implications of bytecode instrumentation. Consult Devco if you need guidance on integration, deployment, or alternative APM solutions.