On Dec 9, 2005, at 10:07 AM, Nix, Robert P. wrote:

This can backfire on you, due to the garbage collection. Adding a
lot more memory sounds attractive, but Java does not reuse heap
space until it is garbage collected. It will add things to the heap
until the space is exhausted, and then start a garbage collection.

The more memory you have, the more abandoned objects there will be
on the heap, and the longer the garbage collection will take.
You'll see your response times run smoothly... With huge "hiccups"
when the heap is exhausted.

Unless you have a large number of objects that you expect to be
statically allocated over a long period of time, you're probably
better off to leave the heap small, and have more, shorter, garbage
collections. Your response will be much smoother across the GCs.

Also, I think I dimly recall that there's some way in Java to force
garbage collection.  So in your app, pick a place where you're
generally waiting for the user anyway--maybe right after repainting
the screen waiting for user input--and force a gc there.  Since the
user will presumably be reading new data from the screen anyway, he
won't notice that the system is briefly unresponsive, since he's not
actually telling it to do anything at that moment.

Adam

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to