I have a GUI desktop application which generates different types of hash (example MD5) for files and directories. Recently, when I was testing with a 1GB test file I recognized that it becomes slower and slower over time. At the first hashing, it takes about 2 seconds for a 1GB file, however later, for the exactly same file, it takes
Tag: memory-leaks
Jprofile to analysis meomery leak in hprof where there is plenty of hashmap entries
I took over a JAVA-WEB based SOA system recently and it doesn’t runs that well untill now. One of the springboot applications will take up up to 100% of the CPU use. By using jastack I get to know that most of the Cpu use was made by GC threads, for there are something in jvm that cannot be collected
CMS GC – How to profile young gen heap?
I’m able to use jmap command to dump JVM memory heap. The issue is, I have a program with heavier young gen GC activities compared to the previous version when checking from the GC logs, and when I ran memory profiler, the biggest objects are always the ones in the old gen. So it makes troubleshooting more difficult when you
LeakCanary detecting a leak in my Java Android app – Google Maps
I am relatively new to the scene with little programming background, therefore I apologise in advance if I ask something silly. I am show a google map using SupportMapFragment. I am doing this to prevent a leak in onDestroyView(), however no clue whether this is right or wrong? Full code is here: https://github.com/warfo09/warforepo/blob/main/MainActivity.java This is what I get when I
Java memory leak with a data source
I have heard many times that not closing database connections might lead to a memory leak. (For example in this article) I tried reproducing the same issue by getting a connection from org.apache.commons.dbcp2.BasicDataSource and not closing it. This is my code: I have repeated the same process almost 400 times and also decreased the initial and max heap sizes. Still,
Using pmap and gdb to find native memory leak
I am debugging a native memory leak in java application. The rss is growing 1GB/day while heap showing no increase. On comparing the output of pmap over time, I see multiple anon blocks getting added either at the top of heap or between two native libraries. Can I say the memory increase between, say sssd_pac_plugin.so and librmi.so, is due to
Garbage Collector not freeing “trash memory” as it should in an Android application
Hello! I’m a beginner Java and Android developer and I’ve been having trouble lately dealing with my app’s memory management. I will break this text into sections, in order to make it clearer and readable. A brief description of my app It’s a game that consists of several stages (levels). Each stage has a starting point for the player and
Calculate Xmx setting and actual heap size from Java dump
I’ve got a heap dump file (java_dump.hprof) written by a Java 7 JVM. Is it somehow possible to calculate the Xmx command line option as well as the actual heap size from this dump? Answer The dump is based on the size actually used but in a different format so it could be bigger. If the dump was triggered on
High memory usage when using Hibernate
I code a server side application with java run on linux server. I use hibernate to open session to database, use native sql to query it and always close this session by try, catch, finally. My server query DB using hibernate with very high frequency. I already define MaxHeapSize for it is 3000M but it usually use 2.7GB on RAM,
Can heap dump be created for analyzing memory leak without garbage collection?
We have some memory leak issues on VMs in production which are running Java applications, the Old Gen heap usage grows fast every day, so I want to create heap dump to analyze it. However, I noticed that VisualVM will perform full GC before heap dump which will clean the Old Gen, in that case, the heap dump would be