in Education by
We've tried jdk 1.7.0_02. Ten days of running give 420 MB memory leak of the following objects: - java.lang.management.MemoryUsage, - [C (array of char), - java.util.HashMap$Entry, - [Ljava.util.HashMap$Entry (array of HashMap$Entry), and some others. This doesn't happen on jdk1.6.x. First output of the "jmap -histo:live" command: num #instances #bytes class name ---------------------------------------------- 1: 229527 14926888 [C 2: 289290 13885920 java.lang.management.MemoryUsage 3: 321029 10272928 java.util.HashMap$Entry 4: 69923 10262184 5: 69923 9527672 6: 7048 7787040 7: 241693 7734176 java.lang.String 8: 2038 5898408 [Ljava.util.concurrent.ConcurrentHashMap$HashEntry; 9: 7048 5479056 10: 5954 4499552 11: 67844 4091672 [Ljava.util.HashMap$Entry; 12: 41250 3942848 [B 13: 65649 3151152 java.util.HashMap 14: 71891 2875640 java.util.TreeMap$Entry ... Total 2320965 138000120 The last output of the "jmap -histo:live" command done in 10 days after the first: num #instances #bytes class name ---------------------------------------------- 1: 3147110 151061280 java.lang.management.MemoryUsage 2: 3178875 101724000 java.util.HashMap$Entry 3: 1087332 53822632 [C 4: 1099503 35184096 java.lang.String 5: 639442 31529224 [Ljava.util.HashMap$Entry; 6: 637247 30587856 java.util.HashMap 7: 629422 25176880 [Ljava.lang.management.MemoryUsage; 8: 314711 17623816 com.sun.management.GcInfo 9: 70107 10292776 10: 631864 10109824 java.util.HashMap$EntrySet 11: 314711 10070752 sun.management.GcInfoCompositeData 12: 70107 9552696 13: 7075 7817080 14: 314713 7554128 [Ljava.lang.Integer; 15: 2048 5898744 [Ljava.util.concurrent.ConcurrentHashMap$HashEntry; 16: 7075 5497200 17: 315792 5052672 java.lang.Integer 18: 47680 4912352 [B ... Total 13206419 558217856 I also have 8 other histograms, made after each day of the tests. They show linear number of objects increasing. This is definitely not a noise. It is a stable leak 42 MB per day. Did you observe similar behavior? In what scenarios? How did you cope with it? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Given the code in Java 7 is slightly different (but almost the same) as Java 6. I would expect to see these very subtle differences. I would take the snapshot after another 2 days to see if the JVM is still warming up. Connecting more monitoring clients would increase these values for example (as these are mostly monitoring objects). If it is a memory leak, at 32K every two days, this could be wasting ~5 MB after a year of running and worth less than 5 cents of memory. Personally I would consider this too small to worry about.

Related questions

0 votes
    I am getting memory leak during migration using Realm (v1.0.2). My code looks like that: let ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have an ETL requirement like: I need to fetch around 20000 records from a table and process each ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have been doing Java development for a long time, but I am ashamed to say I still don't have ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I have been having some issues with LINQ-To-SQL around memory usage. I'm using it in a Windows ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I have been having some issues with LINQ-To-SQL around memory usage. I'm using it in a Windows ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I have been having some issues with LINQ-To-SQL around memory usage. I'm using it in a Windows ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    Which one of the following causes memory leak? (a) Release database connection when querying is complete (b) ... Miscellaneous of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    I am writing some code that uses MPI and I was keeping noticing some memory leaks when running it with ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    What is meant by a memory leak in Java, and how to implement it. Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    What is meant by a memory leak in Java, and how to implement it. Select the correct answer from above ... ,Core Questions, Core Hadoop MCQ,core interview questions for experienced...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    Which of the below is not a memory leak solution? (a) Code changes (b) JVM parameter tuning (c) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which one of the following causes memory leak? (a) Release database connection when querying is complete (b ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    When does a memory leak happen? (a) Browser doesn't release memory from objects unnecessary (b) Browser ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    When does a cycle occur during memory leak? (a) No reference occurs (b) Two objects reference (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    What is the memory leak in C?...
asked Jan 23, 2021 in Technology by JackTerrance
...