Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Memory consumption: String vs char array

807580Mar 22 2010 — edited Mar 22 2010
I have a java application which in Jprofiler shows tens of thousands of strings created. We are using strings in our application and frequently re-initialize them, but not to the extent that the count moves up to ten of thousands. Strings are immutable structures. Is it that the strings shown in JProfiler are the ones that are being created but not cleaned up?

Should we use charArrays instead? They are mutable.

Vivek
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2010
Added on Mar 22 2010
11 comments
965 views