0

In my CSV files, there are some strings that appear many time. I see in visualVM that in my app there are a lot of instances of the same string. How to use string intern with Apache commons CSV ?

mar3
  • 11

1 Answers1

1

You can intern() the Strings yourself after they have been returned from Apache commons CSV. This will make the other (now temporary) Strings eligible for garbage collection. Should be easy to create a simple wrapper for this.

marthursson
  • 3,242
  • 1
  • 18
  • 28