Questions tagged [java-memory-leaks]

52 questions
8
votes
1 answer

Why is Java11 keeping java.util.zip.ZipFile$Source on heap?

Can somebody help me understand if what I see is deliberate, correct behaviour or some kind of leak in Java11? Let's take a stupid-simple hello world app: package com.example; public class HelloWorld { public static void main(String[] args)…
tporeba
  • 867
  • 10
  • 23
5
votes
0 answers

Java objects unnecessary promotion to old generation just after a minor gc causing memory fragmentation issues

We are facing a strange memory leak issue in our application. GC configuration: ParNew + CMS A certain type of Objects are getting promoted to old generation too early and causing severe fragmentation issues. Survivor had enough space to…
4
votes
1 answer

Java Memory issue : Java.lang.ref.finalizer object

In most of the research about the memory leak caused by finalizer object, either in our code or in a dependent library, one should be overriding the finalize method. But in my whole project its nowhere used. (I am using Java8) I am facing a memory…
arqam
  • 3,582
  • 5
  • 34
  • 69
4
votes
2 answers

Memory issue with JAX RS using jersey

We currently have some trouble on a productive server as it consumes way too much memory. One of the leaks could come from the jersey client. I found the following two other questions and a how to: How to correctly share JAX-RS 2.0 client Closing…
Thomas
  • 6,325
  • 4
  • 30
  • 65
3
votes
1 answer

LazyList memory leak in Jetpack Compose

I found out that LazyList generates memory leaks. When I scroll down to the bottom of the list memory usage by my app increases by ~3MB. After I scroll up and usage also increases by ~3MB. Memory usage increases all the time is scroll list. How to…
3
votes
1 answer

LeakCanary not giving enough information to identify leak

I'm using LeakCanary but the heap analysis result doesn't provide enough information to detect any leak. It only mentions that the activity is leaking. D/LeakCanary: ​ ==================================== HEAP ANALYSIS RESULT …
3
votes
0 answers

How do I analyze a Java heap dump when local memory is less than the size of the dumped heap?

I have a really big hprof file about 21G which located on a remote server with 32G memory, and I would like to understand what happened in my program. However, on my local desktop I have only 8G memory so it's impossible to launch this file…
Nikita Duginets
  • 163
  • 1
  • 6
3
votes
1 answer

Java Process with constant heap size allocates more and more memory in OS

I have a java application which seems to allocate more and more memory from OS(but the heap size isn't growing at all!) It's an application communicating with a PLC so it needs quite some CPU. for testing porpuse I have written this program, to be…
user2071938
  • 2,055
  • 6
  • 28
  • 60
3
votes
1 answer

Anonymous class hidden reference to local variable

I encountered a reported memory leak in my Android app, after some investigation I pretty much find out where the leak is, here is the simplified code: public class LeakTracker { public static List callbacks = new ArrayList<>(); …
darklord
  • 5,077
  • 12
  • 40
  • 65
3
votes
1 answer

JFrame is never garbage collected

I have an application that needs to open multiple JFrames (it's a log viewer, and sometimes you need to see a bunch of logs in separate windows to compare). It appears that the JVM (Java 8 update 101 on OS X) is holding a strong reference to the…
Jesse Barnum
  • 6,507
  • 6
  • 40
  • 69
2
votes
0 answers

Java | Memory Leak issue due to sun.security.ssl.SSLSessionContextImpl

In our application we are using Spring Framework v2.3.3.RELEASE. The application acts as a GRPC Server and responds to GRPC Requests sent from another application (It's micro-service architecture). During our Performance Testing, we observed very…
2
votes
1 answer

How much memory takes TreeMap collection granularly?

How much memory takes TreeMap collection filled with 1000 (all unique) key-value pairs? Yes I can just watch memory dump, but need to know granularly why exactly: Long = n bytes Entry = 2n bytes, so 1000 entries = 2000n…
J.J. Beam
  • 2,612
  • 2
  • 26
  • 55
2
votes
2 answers

Which java garbage collector we should use for spring boot with java 11 and Ubuntu 18

We have 10 spring boot applications which are running on ubuntu18 with 8GB RAM and Java 11. We are running the apps using java garbage collector -XX:+UseSerialGC without restricting the heap space. But after few days server memory fully consumed and…
Krish
  • 1,804
  • 7
  • 37
  • 65
2
votes
1 answer

Overwrite (zeroize) a string password in Java

I made the mistake of storing a password as a String in a Java program. I would like to prevent this String password from appearing in a heap dump/memory dump. Ideally, I should have used a char[] and filled it with zero after use (as recommended by…
MediumOne
  • 804
  • 3
  • 11
  • 28
2
votes
1 answer

Spring Batch Jobs do not release memory

I am running around 18.000 spring jobs in parallel, each with one step. Each step consists of reading from a file, converting and manipulating those values and writing them to a Mongo and MySql database, nothing unusual. After all of the jobs…
skylla
  • 464
  • 3
  • 7
  • 17
1
2 3 4