ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kev Jackson <kevin.jack...@it.fts-vn.com>
Subject Re: AW: Adding a methof to StringUtils
Date Wed, 19 Apr 2006 10:56:54 GMT

>javap -c AAA
>
>public java.lang.String concat(java.lang.String, java.lang.String, java.lang.String);
>  Code:
>   0:   new     #2; //class java/lang/StringBuilder
>   3:   dup
>   4:   invokespecial   #3; //Method java/lang/StringBuilder."<init>":()V
>   7:   aload_1
>   8:   invokevirtual   #4; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
>   11:  aload_2
>   12:  invokevirtual   #4; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
>   15:  aload_3
>   16:  invokevirtual   #4; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
>   19:  invokevirtual   #5; //Method java/lang/StringBuilder.toString:()Ljava/lang/String;
>   22:  areturn
>
>  
>
[snip 1.4 output]
Thanks for showing me this, it's time I re-read the JVM spec I suppose 
as it's obviously been updated!

It is strange though that by making changes to an explicit StringBuffer 
instead of using String concatenation, the memory usage of the AppFuse 
build was reduced enough to avoid an OutOfMemory error.

The point about building the strings when they aren't used (because 
logging verbosity is set too low) still stands though - this is less 
than efficient

Thanks
Kev

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message