Andrei Antonescu wrote:Hello all,
I am using string concatenation in a while loop to create a really big string. Could this take the CPU load to 100% or should I look for somethig else for answers to the CPU load problem ?
Thanks,
If by "concatenation" you mean either
str += someOtherStr or the explicit use of the concatenate() method, then, yeah, that could be a problem for large strings in a tight loop.
However, rather than guessing at where the problem might be, you're better off using a profiler to measure it. JProbe, JProfiler, OptimizeIt, and AppPerfect all have either limited time or limited functionality demo versions, and the JDK comes with jvisualvm.