If you use literal strings, they will be interned automatically.

On Sat, Sep 25, 2010 at 9:53 PM, smallufo <[email protected]> wrote:
> I am using a profiler to analyze an OOM heap-dump file , and find tons of
> duplicated Strings .
> These strings are mostly IDs of wicket components or PropertyModel's
> expression ...
> I wonder if it a good practice to "intern()" all these Strings ?
>
> such as :
>
> private final static String TIME_STR = "time".intern();
> add(new Label(TIME_STR , foobar));
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to