Article View: news.software.readers
Article #7437Re: TIN is a huge pig -- still -- IS THERE A FIX FOR THIS COMING?
From: Pope Clifton
Date: Thu, 20 Jan 1994 07:47
Date: Thu, 20 Jan 1994 07:47
124 lines
4882 bytes
4882 bytes
Karl Denninger (karl@MCS.COM) wrote:
: I am at my wits end.
: If there is no fix for this sometime soon TIN gets tossed, perhaps
: permanently, off MCSNet.
I don't know quite why you are having more problems than other sites.
Netcom also had a lot of problems.
One of the Netcom support guys got a friend to come up with a patch and
submitted it. I think it is in testing for 1.2PL3, but that seems to be
taking a while.
I have dropped out of the maintenance cycle due to arthritis, but here is a
copy of the patch. I take no responsibility.... Also, you might have to
make adjustments in applying it to 1.2PL1 which works better in many
respects.
-- Clifton
========================================
From hawkeye@glia.biostr.washington.edu Sun Dec 5 21:13:06 1993
Return-Path: <hawkeye@glia.biostr.washington.edu>
Received: from mailhost1.cac.washington.edu by mail.netcom.com (8.6.4/SMI-4.1/Netcom) id VAA13571; Sun, 5 Dec 1993 21:13:04 -0800
Received: from glia.biostr.washington.edu by mailhost1.cac.washington.edu (5.65/UW-NDC Revision: 2.28 ) id AA00401; Sun, 5 Dec 93 21:12:39 -0800
From: hawkeye@glia.biostr.washington.edu (Ken Keys)
Posted-Date: Sun, 5 Dec 93 21:20:54 PST
Message-Id: <9312060520.AA07331@glia.biostr.washington.edu>
Received: by glia.biostr.washington.edu (911016.SGI/Eno-0.1) id AA07331; Sun, 5 Dec 93 21:20:59 -0800
Subject: Patch to tin 1.22
To: iain.lea@erlm.siemens.de
Date: Sun, 5 Dec 93 21:20:54 PST
Cc: sterling@oldcolo.com, cliftonr@netcom.com
X-Mailer: ELM [version 2.3 PL11]
Status: RO
At the request of Bruce Sterling Woodcock (sterling@oldcolo.com), I
wrote a patch that signifigantly reduces the memory usage of the
program. In the t_notice structure, instead of delaring name with
length MAXPATHLEN, I allocate it dynamically. I figure this is an
average of 20 bytes (plus malloc overhead) per group, instead of 1024.
For ~4000 groups, that's a BIG savings.
--
Ken "Hawkeye" Keys | If you use TinyFugue, help support it.
hawkeye@glia.biostr.washington.edu | Send donations to: Ken Keys
------------------------------------+-------------+ 1820 Cottonwood Av.
Official TF ftp site: glia.biostr.washington.edu | Carlsbad CA 92009
diff -c tin-1.22/active.c tin-ksk/active.c
*** tin-1.22/active.c Sat Sep 25 07:30:08 1993
--- tin-ksk/active.c Sun Dec 5 20:44:44 1993
***************
*** 524,535 ****
if (buf[0] == '.') {
break;
}
! strncpy (old_active[num].name, buf, sizeof (old_active[num].name));
! ptr = old_active[num].name;
while (*ptr && *ptr != ' ' && *ptr != '\n') {
ptr++;
}
! *ptr = '\0';
old_active[num].visited = FALSE;
num++;
if (num >= max_old_active) {
--- 524,545 ----
if (buf[0] == '.') {
break;
}
!
! ptr = buf;
while (*ptr && *ptr != ' ' && *ptr != '\n') {
ptr++;
}
!
! /*
! * The average length of a name including '\0' is around 20 bytes.
! * So instead of using an array of length MAXPATHLEN (==1024),
! * we allocate only what we need here. For 4000 group names,
! * this reduces the process size by over 3.8 M. --Ken Keys
! */
! old_active[num].name = (char *) my_malloc(ptr - buf + 1);
! strncpy(old_active[num].name, buf, ptr - buf);
! old_active[num].name[ptr - buf] = '\0';
!
old_active[num].visited = FALSE;
num++;
if (num >= max_old_active) {
***************
*** 731,736 ****
--- 741,748 ----
* Free malloc'd arrays
*/
if (old_active != (notify_p) 0) {
+ for (i = 0; i < num; i++)
+ free (old_active[i].name);
free ((char *) old_active);
old_active = (notify_p) 0;
}
diff -c tin-1.22/tin.h tin-ksk/tin.h
*** tin-1.22/tin.h Sat Sep 25 07:30:04 1993
--- tin-ksk/tin.h Sun Dec 5 17:19:04 1993
***************
*** 1040,1046 ****
struct t_notify
{
! char name[PATH_LEN];
int visited;
};
--- 1040,1046 ----
struct t_notify
{
! char *name;
int visited;
};
--
cliftonr@netcom.com Clifton Royston, Pope of the CotSG in Paradise
Technical Details
Message-ID:
<cliftonrCJx4Bt.B8r@netcom.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!xlink.net!zib-berlin.de!netmbx.de!Germany.EU.net!EU.net!uunet!olivea!decwrl!decwrl!amd!netcomsv!netcomsv!netcom.com!cliftonrReferences:
<2hic56$2n7@Mercury.mcs.com>Show Full Headers
Complete Article Headers
Message-ID: <cliftonrCJx4Bt.B8r@netcom.com> Subject: Re: TIN is a huge pig -- still -- IS THERE A FIX FOR THIS COMING? Date: Thu, 20 Jan 1994 07:47:53 GMT From: cliftonr@netcom.com (Pope Clifton) References: <2hic56$2n7@Mercury.mcs.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!xlink.net!zib-berlin.de!netmbx.de!Germany.EU.net!EU.net!uunet!olivea!decwrl!decwrl!amd!netcomsv!netcomsv!netcom.com!cliftonr Newsgroups: news.software.readers Organization: Dr. Anaconda's Solar Fun Club X-Newsreader: TIN [version 1.2 PL1] Lines: 124