Chris Abbey wrote:

> ...running 117_v1a, native, with the -verbosegc option I see that a quick run
> on my "toy" system produced 137598 objects and 8000423 bytes worth of trash!
> ... I would highly recommend that you
> write your own readln method taking a char[] or a StringBuffer if you
> _have_ to have an object and recycling a single object throughout the
> operation. Just because gc is there doesn't mean we _have_ to use it ;)
>

Hi,

Thanks - I really hadn't considered the fact that the call to readLine() may be
creating a lot of throw-away objects, too.  I just saw that my loop was creating
one String object per iteration, so I thought, "That's not too bad." :)

I'm still confused, though, by the output from -verbosegc.  When I ran it, there
was always a message at the same time as one of these 1-2 second pauses.  Made
it obvious that gc had something to do with this.  But the gc messages claimed
that the garbage collection took only a few milliseconds, while the perceptible
pause was at least a full second.

- Robb


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to