Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsTo find a Java memory leak, track the heap’s live set after garbage collection, capture evidence while memory is growing, and identify which objects remain reachable and why. Use Java Flight Recorder (JFR) with JDK Mission Control (JMC) to observe growth over time; use a heap dump with Eclipse Memory Analyzer (MAT) to inspect object retention in detail. If heap evidence does not explain rising process memory, investigate native and JVM-internal memory separately. Then fix the owning code or resource lifecycle and repeat a comparable workload to verify that growth has stopped.
What counts as a Java memory leak?
A memory leak is memory that remains retained after the application no longer needs it. A high heap reading alone does not establish a leak: the application may simply need a larger heap or may be experiencing a temporary workload peak. Look instead for a live set—the heap still in use after garbage collection—that continues to rise over time, often alongside increasingly frequent garbage collection.
Oracle’s Java SE 12 troubleshooting guidance identifies slowdown, frequent garbage collection, and eventual OutOfMemoryError as possible signs, but those symptoms can have other causes. An OutOfMemoryError: Java heap space means a heap allocation could not be satisfied; it can result from unintended retention, an undersized heap, or application code retaining more data than expected. Read the full error detail rather than treating every OutOfMemoryError as proof of a leak. Oracle’s Java SE 12 memory-leak guide explains these distinctions.
Start by confirming that memory accumulates
Observe the application under a representative workload and compare memory after old or full collections, where applicable. A single reading cannot show whether the live set is stable or growing. Record the workload, JVM vendor and version, heap settings, and timestamps so later recordings can be compared under similar conditions.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- Stronger evidence: post-collection heap use rises across comparable periods, with GC activity becoming more frequent.
- Not enough on its own: a high current heap reading, one large allocation, or an isolated
OutOfMemoryError. - Check the error detail: heap-space exhaustion, GC-overhead conditions, and native allocation failures point to different diagnostic questions.
Capture JFR while the growth is happening
JFR records events over time, making it useful for seeing which object types grow during the leak window. Oracle’s Java SE 26 Troubleshooting Guide states: “To detect a memory leak, JFR must be running at the time that the leak occurs.” Oracle describes JFR as having less than 1% overhead and as designed to be safe to leave on in production; treat that as Oracle’s stated context, not a guarantee for every JVM build and workload. Check the behavior of the exact JVM release and vendor you operate. Oracle’s Java SE 26 guide documents JFR capture and analysis.
Start or dump a recording
To start a recording when launching a Java process, Oracle’s guide gives this basic option:
java -XX:StartFlightRecording
For a running JVM, the guide documents dumping a recording with jcmd:
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
jcmd pid JFR.dump filename=recording.jfr path-to-gc-roots=true
Replace pid with the target JVM’s process ID. Collecting paths to GC roots can add diagnostic cost; Oracle’s Java SE 12 guide cautions that gathering paths takes time, so enable it when a suspected leak makes that detail useful. Command options and event availability can vary by JDK release and vendor.
Free tools Windows power users keep installed
One-click scans. No signup required.
Inspect growth in JMC or with the JFR command line
Open the recording in JDK Mission Control and inspect Live Objects and old-object samples. Compare class instance counts and shallow heap sizes over the recording or across comparable recordings. Instance counts matter: many small objects can retain a much larger object graph. Old Object Sample events may include allocation time, an allocation stack, and a path to a GC root.
You can also print old-object samples from the command line:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
jfr print --events OldObjectSample recording.jfr
Samples are clues, not a complete census. A slow leak or a particular allocation site may not appear in sampled events; the absence of a sample does not rule out a leak. Oracle’s JDK Mission Control overview describes the tool for analyzing JFR recordings.
Use a heap dump to find what keeps objects alive
JFR helps show what changes over time; a heap dump gives a detailed view of the object graph at one point in time. Obtain a dump using a diagnostic workflow supported by your JDK, then open it in Eclipse MAT. In MAT, begin with the Dominator Tree and sort by retained size. A dominator’s position in the reachability graph makes it responsible for keeping its descendants reachable; retained size estimates the memory that could become collectible if that object and its references were removed.
Follow the retention evidence
- Use Top Consumers to locate large object groups.
- Group by class or class loader when no single object dominates.
- Use Paths to GC Roots on a suspect object to find the reference chain that keeps it reachable.
- Review MAT’s Leak Suspects report as a lead, then determine whether the retention is actually unintended for the application’s lifecycle.
A large retained graph is not automatically a leak: caches and other long-lived structures can be intentional. The important question is whether the objects are still needed. Eclipse describes MAT as capable of analyzing productive heap dumps with hundreds of millions of objects, but that is a capability description, not a promise about analysis time or resource requirements for a particular dump. See Eclipse’s guides to finding memory leaks in MAT and the Eclipse Memory Analyzer.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
When heap data does not explain process memory
The Java heap is only part of a JVM process’s memory footprint. If process memory rises while heap occupancy does not account for the increase, investigate native and JVM-internal memory rather than increasing -Xmx without evidence.
Oracle’s Java SE 26 troubleshooting guide covers Native Memory Tracking (NMT), memory categories, and procedures for using NMT to detect memory leaks. JNI libraries and other native allocations may require platform-specific tools or instrumentation to track allocations and frees; the appropriate method varies by operating system and native implementation. Other distinct issues include class-loader or metaspace growth and excessive finalization. Choose diagnostics for the memory pool or allocation type implicated by the evidence.
Choose the diagnostic method for the question
| Method | Best evidence | What to inspect | Trade-off |
|---|---|---|---|
| JFR with JMC | Time-based runtime recording and object samples | Live Objects, old-object samples, class growth, allocation and root context | JFR must be active during the leak window; collecting GC-root paths adds diagnostic cost. Oracle describes JFR as low overhead in its Java SE 26 guide. |
| Heap dump with Eclipse MAT | Detailed object graph at one point in time | Retained size, dominators, top consumers, paths to GC roots, suspect report | Large snapshots can require substantial storage and analysis resources; Eclipse gives no universal threshold. |
| NMT and native tools | JVM-internal and native allocation categories | NMT categories and JNI allocation/free paths | Use when heap evidence does not explain process growth; tools and procedures vary by platform. |
These methods answer different questions. JFR provides a time-based view, while a heap dump provides a snapshot; JMC and MAT are complementary, not interchangeable.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Fix the owner and verify the change
Once a retaining path or native allocation points to an owner, change the code or lifecycle that allows memory to outlive its useful lifetime. Depending on the evidence, inspect unbounded caches or collections, listeners and callbacks that are never deregistered, static references, long-lived thread-local values, and class loaders that remain reachable. These are investigation targets, not a ranking of causes. If the evidence points to native allocations, correct the native or JNI ownership and freeing path instead.
- Re-run the same or a comparable workload with the same observation period and capture method.
- Compare post-GC live-set behavior and the classes, retaining paths, or native allocation categories that grew before the change.
- Consider the fix supported when the previous accumulation pattern no longer appears and the live set stabilizes under that workload.
Increasing heap capacity may postpone exhaustion when the application genuinely needs more memory, but it does not remove an unintended reference. Likewise, forcing garbage collection cannot reclaim objects that remain reachable.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




