From owner-freebsd-questions Thu Aug 12 9:11:26 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 1B8B214F06 for ; Thu, 12 Aug 1999 09:11:22 -0700 (PDT) (envelope-from crandall@matchlogic.com) Received: by houston.matchlogic.com with Internet Mail Service (5.5.2448.0) id ; Thu, 12 Aug 1999 10:09:21 -0600 Message-ID: <64003B21ECCAD11185C500805F31EC0303786BD3@houston.matchlogic.com> From: Charles Randall To: Alec Kalinin Cc: freebsd-questions@freebsd.org Subject: RE: Problem with allocation memory in FreeBSD-3.2-RELEASE Date: Thu, 12 Aug 1999 10:09:13 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="koi8-r" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Looks like you're simply running the system out of swap by allocating and touching 1 MB one thousand times for a total of 1 GB. Malloc will eventually return NULL to indicate the system is out of memory. Since you don't check for this, I'd expect a core dump when malloc returns NULL and then you try to fill with zeros. What did you expect to happen? Charles -----Original Message----- From: Alec Kalinin [mailto:alec@relex.ru] Sent: Thursday, August 12, 1999 4:18 AM To: freebsd-questions@freebsd.org Subject: Problem with allocation memory in FreeBSD-3.2-RELEASE Hello! I have a problem with allocation memory in FreeBSD-3.2-RELEASE. This simple program hungs my system: ------------------- begin program ----------------------------- #include #include #define NALLOC 1000 #define SIZEALLOC 1024*1024 #define WAIT 100 void main() { char *p_mem; int i, j; if (fork() != 0) return; for (i=0; i