From owner-freebsd-questions Tue Aug 10 12:58: 2 1999 Delivered-To: freebsd-questions@freebsd.org Received: from houston.matchlogic.com (houston.matchlogic.com [205.216.147.127]) by hub.freebsd.org (Postfix) with ESMTP id EBD7D15454 for ; Tue, 10 Aug 1999 12:57:56 -0700 (PDT) (envelope-from crandall@matchlogic.com) Received: by houston.matchlogic.com with Internet Mail Service (5.5.2448.0) id ; Tue, 10 Aug 1999 13:57:16 -0600 Message-ID: <64003B21ECCAD11185C500805F31EC0303786B0B@houston.matchlogic.com> From: Charles Randall To: Charlie ROOT , freebsd-questions@FreeBSD.ORG Subject: RE: System hang when mmap() large files Date: Tue, 10 Aug 1999 13:57:16 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG From: Charles Randall [mailto:crandall@matchlogic.com] >Are you running the machine out of swap? Looks like you >mmap 10 new MB on each iteration. What happens if you munmap() >the region before the close()? I didn't phrase that very well. Is this what you intended or were you trying to point out a problem with FreeBSD's mmap()? Charles --- mmap.c.orig Tue Aug 10 13:54:40 1999 +++ mmap.c Tue Aug 10 13:55:13 1999 @@ -1,3 +1,5 @@ +#include +#include #include #include #include @@ -29,7 +31,11 @@ printf("mmap error %ld",errno); exit(1); } - close(fd); memset(addr,'x',len); + if ( munmap(addr, len) != 0 ) { + fprintf(stderr, "munmap failed\n"); + exit(EXIT_FAILURE); + } + close(fd); } } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message