I have a web application in Tomcat where I do many String operations (substring, indexof, trimming, etc.). I made a heap dump with jmap and I loaded it using VisualVM and I realized that near 50% of my heap memory usage is with char[], Why the char[] are taking that memory usage?, should I be concerned?, is it something related to String pools?
Strings are internally just a char[] and some extra data. A char[] means a character array in other words it's an array that saves your string character by character. If you do a lot of string proccessing it's entirely possible that your system is fileld with char arrays.
So in short nothing to be concerned unless you system is actually using more memory then it should be. In that case you can look if there are some file structures left uncleared (hash maps or related).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With