2

I am using wildfly-9.0.1.Final on server.
Allocated memory is 20 GB with UseG1GC and UseStringDeduplication(with default threshold) flag.

I faced high memory usage on server, for troubleshooting I had collected heapdump. I used Eclipse MAT for heapdumnp analysis. The problem suspect suggest large nos. of String and StringBuilder object.Problem Suspect

When I run String: group by value. I saw large number of duplicate String.

String Value                                            |     Objects | Shallow Heap | Avg. Retained Size | Retained Heap
--------------------------------------------------------------------------------------------------------------------------
/D:/wildfly-9.0.1.Final/bin/content                     |   12,67,828 |  3,04,27,872 |                112 |  >= 135.42 MB
/D:/wildfly-9.0.1.Final/bin/content/myApp-ear.ear       |   12,67,828 |  3,04,27,872 |                144 |  >= 174.11 MB
/D:/wildfly-9.0.1.Final                                 |   12,67,827 |  3,04,27,848 |                 88 |  >= 106.40 MB
/D:/wildfly-9.0.1.Final/bin                             |   12,67,827 |  3,04,27,848 |                 96 |  >= 116.07 MB
/D:/wildfly-9.0.1.Final/bin/content/myApp-ear.ear/lib   |   12,64,464 |  3,03,47,136 |                152 |  >= 183.29 MB


I have check for some of the String and path to GC It look like this String is constructed by JVM/container.

path to GC

Is there any configuration to avoid these large nos. of String objects or I can troubleshoot this issue further.

mcacorner
  • 1,304
  • 3
  • 22
  • 45
  • 2
    The `String` fraction of the total heap doesn’t look unusual. What’s really baffling, is the amount of `StringBuilder` instances, as they are normally used for temporary work and not kept referenced. It’s not so imported where they are constructed but what keeps the reference to them. – Holger Apr 16 '20 at 10:17
  • 1
    So, I need to focus on those *StringBuilder* objects right? – mcacorner Apr 16 '20 at 11:27

0 Answers0