[comp.os.minix] Tar memory leak

cechew@bruce.cs.monash.OZ.AU (Earl Chew) (04/06/91)

Here is a patch to tar to cure a memory leak.

1. Directories are remembered twice.
2. Once remembered, inodes are never forgotten.

This has a bad effect on large file systems where there are many directories.
Each directory costs you double (since it's remembered twice) and once the
directory is scanned, it is not forgotten.

I wonder how many people have given up on tar and are using gnu-tar or pax?

Earl
-------------------------------------------------------------------------------
table
 !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
begin 644 tar.c.cd.Z
M'YV-*@*"H!-&CHLQ?A),"4,'1! X<D" L $"Q@T=-63HF $#1(P<.6(H:$%Rz
M8,&#"ADZA"B1HD6,.'3$H/@QI(* .'/J5'%3((T9+&C@ )%S9,F?+&IT)$E2y
M@42B$NO,*0/BC1D09-+(*3.&SALY>5#,2 %"SILZ=-*X*3,G@=L$2Z: F/$Bx
M!HP7.'(XE:A"(IDR;,K0*4,&A%2J5K%^<1.F36 W(*8&[OJUZM4Y=.34Z8I5w
M:QDW=-S&]8BC[MV\>Z%&K@,'SM>&;=:X>4.&!@H9*=Z^+3($Q(T7OW/ 4+""v
MKT0S7\\(!J&6-EL0=]!\!L%&[1H08\Z"!E$&#QS/;=WRGOB"Q@N;Q563>>/Fu
M1,.M;<JT$5,F8M:ME.6D>:Z"SITT8Y2A0@BI\?147T+4<<8<.A0HD1WUB?'&t
M5""TX1QS<X PVWMEN"9'6FZ<@1U[<Z2!V6=T]+33BBIZ-(,-+,3P$U$X[869s
M9IQ5Y\9U>Z3&W&Q?--3<#C[^94>06)5A!Y$A/#4&&@5IV%@96S@11!-3)*%%r
M%TP^=>-F#>EXG0IKX4$'D1+U09280;X!!P@]@.!$%4PP@28(>R%11!!$%"$%q
M"-*%\9<<1#+E(@XQTD 14RW8F!F8U%D'0H]/_?@&DD,6J2221G8ID1ML-@2Jp
M=9Y&]FB.DI+9W9D*-"G1DU$R%M\6,7"YEYHJA.HFG'+2:>=>>>[9YY^!#D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D8\TAQ\L^j
MPEG!W%ID 5O%[ ,\-"H[DLS++!A3Z,Q3PBM4UH6]ZRH:\LW0G,W37,T;<\WMi
M&,VHLB,IL (W\ACAR<WHRC7/S)OB?#_D7'HB8,X-D1ANM,Z(LX?N_$"DS!.Fh
M/!/TK#2L_"G?3%IETA!QHBM[52FUG%M*PBL^+-'#V"D^4M4^T!Q8O<9:G::Sg
M04,JW&U>38<=78\P5,9YB,:H(]6\4LO-NSXP,\7I8S:. J#O0Q3BB]/UXL\5f
MK0)CT$&\(M79!M)8ZDB&O8;B;$N<5=AR8-5V &)BS4-& DG&R-B3_=6S8=G&e
MK&+)Z<[8T4%./25 %:5$)=F\(ME.O2JH0]J-5=<Q",\S !0X< ,<#(54W=0^d
M\-2';1UM,M5/X=5&$M;&S-6]?0>D!=9B>MG#F"D@G=;(_-S&3-'7\3@)XV:Bc
M:9V^38<.<\!R'2=T?2O 4ARC"QB"D=?T(S[9#+Z'61P](M DG2IOP 9D$-"Tb
M^@9V; 9;X4Z-4QSBT\TH<-^OH\W#K89Q<M/SG43C717X_=IFHM^5XM]EX$X&a
M'N!/$4+%P>&]/-#EXYI,ZCXK=;]\K1+ARRKC^SE].<VL'=7"[16!&=@K/2;]z
MNQ6\8@*(S=WO R #[3!5\M9;DMA7B@:+Q=E7_-A3%-FF75I7O899C=E*\M#$y
MS-G-_=E0#MUD_08?MI40\<8FX-J_#=M.9MAQ(N9/W65$*50)U3XD@>;5[=!Kx
IF@ W_L9H3N::A:_AR4=-3H=FK(>(1=KO2U3F2=IHCMJVU,>R[2NTC2?5w
 v
end
-------------------------------------------------------------------------------
-- 
Earl Chew, Dept of Computer Science, Monash University, Australia 3168
EMAIL: cechew@bruce.cs.monash.edu.au PHONE: 03 5655778 FAX: 03 5655146
----------------------------------------------------------------------

eesrajm@cc.brunel.ac.uk (Andrew J Michael) (04/07/91)

In article <3910@bruce.cs.monash.OZ.AU>, cechew@bruce.cs.monash.OZ.AU (Earl Chew) writes:
> 
> Here is a patch to tar to cure a memory leak.

(Patch deleted)

> I wonder how many people have given up on tar and are using gnu-tar or pax?
> 
> Earl

Me for one.  I gave up on the MINIX tar once I got GNU tar 1.09 running on
both 68k and 386.  The MINIX tar gave me a lot of trouble backing up large
directories (~ 32Mb) to tape, so I switched to GNU.  Apart from the fact 
that GNU tar works(!), the -d option for checking archives back against the 
original is a great feature.

Andy Michael


-- 
Andy Michael                                     "You might think that.  I
85 Hawthorne Crescent                             couldn't possibly comment."
West Drayton					    - `House of Cards'
Middlesex            email: eesrajm@brunel.ac.uk                             
UB7 9PA           or Andrew.Michael@brunel.ac.uk

Alan_T._Cote.OSBU_South@xerox.com (04/09/91)

Andy -

I infer from your referenced note that you have some kind of TAPE driver for
MINIX.  Is this true?  What kind of tape/drive?  Would you consider sharing?

Thanks.

- Al

eesrajm@cc.brunel.ac.uk (Andrew J Michael) (04/10/91)

In article <50092@nigel.ee.udel.edu>, Alan_T._Cote.OSBU_South@xerox.com writes:
> Andy -
> 
> I infer from your referenced note that you have some kind of TAPE driver for
> MINIX.  Is this true?  What kind of tape/drive?  Would you consider sharing?
> 
> Thanks.
> 
> - Al

A couple of people spotted this one and asked me by email, so I'll reply to
all of you.

Yes I do have a tape driver for MINIX - on my 68020 box.  It talks to SCSI
tape drives like the Wangtek 5099ES and the Archive Viper.  This allows me 
to interchange tapes with the Suns at work, as well as performing backups.

The driver is based on the hard disk driver for the ST; adapting it to talk
to a tape rather than an disk isn't very hard, which of course is the whole
concept of SCSI anyway.  So I'm afraid it isn't a generic driver which can
be used on (say) PCs.  I've recently bought a second-hand WD7000 SCSI card
for my 386, and I might (repeat might) have a go at a driver for that if I
have the time and get get any hardware info on the card.

Regards
Andy Michael



-- 
Andy Michael                                     "You might think that.  I
85 Hawthorne Crescent                             couldn't possibly comment."
West Drayton					    - `House of Cards'
Middlesex            email: eesrajm@brunel.ac.uk                             
UB7 9PA           or Andrew.Michael@brunel.ac.uk

waltje@uwalt.nl.mugnet.org (Fred 'The Rebel' van Kempen) (04/16/91)

cechew@bruce.cs.monash.OZ.AU (Earl Chew) wrote:
> 
> Here is a patch to tar to cure a memory leak.
> 
> 1. Directories are remembered twice.
> 2. Once remembered, inodes are never forgotten.
> 
> This has a bad effect on large file systems where there are many directories.
> Each directory costs you double (since it's remembered twice) and once the
> directory is scanned, it is not forgotten.
> 
> I wonder how many people have given up on tar and are using gnu-tar or pax?

Nope- just use PdTar, and be In Heaven ... :-)

Fred.
--
MicroWalt Corporation, for MINIX Development	waltje@uwalt.nl.mugnet.org
Tel (+31) 252 230 205, Hoefbladhof  27, 2215 DV  VOORHOUT, The Netherlands
	"An Operating System is what the _USERS_ think of it- me"