5 ms·
I don't think an average is useful in any way here. It will reduce the heap use by some amount, since you reduce the number of char arrays in N strings to some
by tetha 12y ago
I don't think an average is useful in any way here. It will reduce the heap use by some amount, since you reduce the number of char arrays in N strings to some number less than - or equal - than N. There won't be any new arrays allocated.
But in my team alone, we have services which deal with many equal but transient strings, some services with long-living, mostly equal strings, some services with long-living, radically different strings. In some of them, I expect rather massive reductions, in others, interning probably has most of the work done already and in others, there's no application or the GC will handle the issue already.
- asdfaoeu 12y agoThe garbage collector needs to store its internal arrays.