Thomas Dudziak wrote:
On 1/26/06, Stephen Colebourne <[EMAIL PROTECTED]> wrote:
It should already be lazily created. The array should begin as 65535
nulls and only get populated as each character is requested.
Nope, YourKit tells me that there are 5 StringUtils.<clinit>() objects
still in memory totalling 1.310.760 bytes.
Doesn't look anything wrong here...
private static final String[] PADDING = new String[Character.MAX_VALUE + 1];
static {
// space padding is most common, start with 64 chars
PADDING[32] = " ";
}
or in the padding method...
String pad = PADDING[padChar];
if (pad == null) {
pad = String.valueOf(padChar);
}
while (pad.length() < repeat) {
pad = pad.concat(pad);
}
PADDING[padChar] = pad;
return pad.substring(0, repeat);
So, I'm struggling to see what might be happening. Nevertheless, if its
wrong it needs fixing.
Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]