lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, 2005-01-09 at 07:47, Mark Hamburg wrote:

> Your framework relies on the feedback loop to discover the effects of minor
> collections on the need for major collections. Is it reasonable to allow
> minor collections to also directly slow major collections by generating
> "negative time" through recovered storage? 

That's really hard to say. In principle in a system almost in 
equilibrium this isn't necessary: if the minor collections collect
more garbage than expected, this will eventually be reflected in
the error term -- so there is no need to fiddle anything, and somewhat
dangerous to do so because it makes it much hard to reason about
the feedback process and thus to adjust the parameters...

HOWEVER .. there's always a caveat ..:->

You could definitely try to force the major collection rate
to adjust more responsively. You'd need to be careful you 
didn't overcorrect though.

Once when testing my dimmer system with a generator,
which is the kind of power you get at an outdoor concert,
we turned up the lights .. and the following happened:

First, the lights got brighter, which put an enormous
load on the generator. Generators have heavy flywheels,
so at first nothing happened. 

As the lights sucked the energy out of the flywheel, slowing it
down, the governor cut in, and opened the throttle to the
motor, to generate more power.

Of course there is a delay before the generator began to
power up, and regain its orginal speed, but as it does,
the governor eases back on the throttle.

Unfortunately .. when the period of the AC output from the
generator got longer as it slowed down, the lights get triggered
even sooner, and get even brighter. Of course, the dimmer noticed
this, and increased the phase locked loop period to
compensate,to  allow the lights to dim down.

Unfortunately just then the generator kicked in and booted
the frequency up again... just as the dimmer was dimming
the lights down . .which reduces the load on the generator.

So the generator overshot, and revved up way beyond the speed
the governor expected.. 

And the process repeated until the rapid changes in light
intensity -- also known as a 'death wobble' finally blew the
globe .. spotlight globes can cost $10,000 each ..

This double feedback also happens on yachts under heavy spinnaker,
and on motorcycles like the Kawasaki 900 I used to ride,
as well as many other systems (the Bay bridge disaster comes to mind
as the most famous example).

So .. a long winded answer is: yes you can fiddle with the feedback
but it isn't easy to get right, more feedback circuits tend to
give better 'usual case' performance but more catastrophic failures.

> Lua has been reasonably successful with an even simpler scheduling mechanism
> for major collections: 

Simple schemes tend to be more stable even if they're not
very responsive, or they're not very well dampened.


-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net