[comp.sys.amiga] Copying EMPTY

ericb@athertn.Atherton.COM (Eric Black) (10/04/88)

In article <12840@cisunx.UUCP> ejkst@unix.cis.pittsburgh.edu (Eric J. Kennedy) writes:
>In article <4275@louie.udel.EDU> mcohen@nrtc.northrop.com (Marty Cohen) writes:
>>Problem: While duplicating EMPTY (to create a sub-directory via
>>moving (there ought to be an easier way - the mac is much nicer
>>here)), the system freezes, the screen goes blank, and the guru
>>appears. Upon reboot, the system tries to access the hard disk
>
>Yeah, why is it that duplicating EMPTY from the workbench is so flakey?
>It doesn't crash my system (with 33 Meg drive) but the system freezes
>for about 10 seconds and the drive light comes on for a long time.  It
>can't take that long to just make a new directory and copy the icon.
>

If you run something which shows memory usage, such as MCLK (one of the
demos that comes with Manx C, is on a Fish disk, floated over the net
a couple of years ago, and I can't remember for sure but I think was
written by Matt Dillon, but if not, sorry... :-), you'll see the
reason for the long hang.  It seems to allocate ALL available memory,
both Fast and Chip, just so it can do a fast copy using lots of memory
buffers.  Then, having allocated everything it can get hold of, it
proceeds to copy the few sectors it takes to duplicate an empty directory
and a drawer icon, then frees up the memory it allocated.  I have 5MB
in my 2000, and it STILL allocates all the free memory to copy the empty
directory.  With 5MB, this takes a while.

This is one optimization I wish they had made a little smarter, like,
look to see what is being duplicated, and THEN allocate memory.

Just about the only time I use the "duplicate" menu item on Workbench
is to duplicate the Empty drawer so my new directory has an icon.
Most of the time I use CLI.  A rule I like to follow is "optimize the
common case, *then* make the worst case better".  This is an example
of not doing that.

Anyway, is it possible that you are running some piece of software
which is not well-behaved in its memory allocation and freeing?  Like,
does it free it and keep using it, so that when you come along and
duplicate Empty the supposedly free memory gets stomped on, and
hello Mr. G?  That might explain the crash.  As others have said, the
long period of occasional HD accesses, and VERRRRY slow operation if
you try to do anything during this period, is due to the disk validator
grovelling over your hard disk to see if anything is amiss.

-- 
Eric Black	"Garbage in, Gospel out"
Atherton Technology, 1333 Bordeaux Dr., Sunnyvale, CA, 94089
   UUCP:	{sun,decwrl,hpda,pyramid}!athertn!ericb
   Domainist:	ericb@Atherton.COM