From owner-freebsd-questions Wed Sep 13 12:45:33 2000 Delivered-To: freebsd-questions@freebsd.org Received: from clearink.com (hellfire.clearink.com [205.227.191.11]) by hub.freebsd.org (Postfix) with ESMTP id 217F337B423 for ; Wed, 13 Sep 2000 12:45:27 -0700 (PDT) Received: from red.clearink.com (red.clearink.com [205.227.189.58]) by clearink.com (8.10.2/8.10.2) with ESMTP id e8DJjIp02950 for ; Wed, 13 Sep 2000 12:45:18 -0700 Received: (from cove@localhost) by red.clearink.com (8.9.3/8.9.3) id MAA99749 for freebsd-questions@FreeBSD.ORG; Wed, 13 Sep 2000 12:45:13 -0700 (PDT) (envelope-from cove@mail.clearink.com) Date: Wed, 13 Sep 2000 12:45:13 -0700 From: Cove Schneider To: freebsd-questions@FreeBSD.ORG Subject: Unable to use all swap? (How to up proc. memory limits?) Message-ID: <20000913124513.R79801@clearink.com> Reply-To: cove.schneider@clearink.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi All, For some reason malloc(3) fails with an out of memory error even though the machine has ~500MB swap left. Am I missing something here? I'm guessing there is some setting in the config file that I don't know about... Any clues/help would be greatly appreciated. Thanks, Cove uname: ---------------------- FreeBSD rommel.clearink.net 4.0-RELEASE FreeBSD 4.0-RELEASE #3: Wed Sep 13 12:20:45 PDT 2000 cove@rommel.clearink.net:/usr/src/sys/compile/ROMMEL i386 swapinfo (real memory = 131,060K bytes): ----------------------------------------------------- Device 1024-blocks Used Avail Capacity Type /dev/ad0s1b 524160 2816 521344 1% Interleaved /dev/ad1s1b 524160 2792 521368 1% Interleaved Total 1048320 5608 1042712 1% testing: ---------------------- Here is the C program I've been testing this with, it mallocs 100mb/sec.. #include int main() { int i; for (i=1; i; i++) { if (!malloc((1024*1024)*100)) { perror("malloc()"); exit(1); } sleep(1); printf("malloc(%u)\r", i); } } Here is a snapshot done at 1/sec intervals of what happens to the swap space when I run the program. It maxes out at %42 and then dies (the process is then around 500MB or so). The %35 there is the kernel freeing of the swap space after malloc(3) failed and the test program exited. Total 1048320 406636 641684 39% Total 1048320 413012 635308 39% Total 1048320 418148 630172 40% Total 1048320 424220 624100 40% Total 1048320 430756 617564 41% Total 1048320 437060 611260 42% Total 1048320 371796 676524 35% Total 1048320 12200 1036120 1% Total 1048320 12176 1036144 1% Total 1048320 11924 1036396 1% Total 1048320 11908 1036412 1% Total 1048320 11908 1036412 1% dmesg: -------------------------- Copyright (c) 1992-2000 The FreeBSD Project. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 4.0-RELEASE #3: Wed Sep 13 12:20:45 PDT 2000 cove@rommel.clearink.net:/usr/src/sys/compile/ROMMEL Timecounter "i8254" frequency 1193182 Hz Timecounter "TSC" frequency 451024594 Hz CPU: Pentium III/Pentium III Xeon (451.02-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x672 Stepping = 2 Features=0x383f9ff real memory = 134205440 (131060K bytes) config> di bt0 No such device: bt0 Invalid command or syntax. Type `?' for help. config> di aic0 No such device: aic0 Invalid command or syntax. Type `?' for help. config> di aha0 No such device: aha0 Invalid command or syntax. Type `?' for help. config> di adv0 No such device: adv0 Invalid command or syntax. Type `?' for help. config> q avail memory = 127098880 (124120K bytes) Preloaded elf kernel "kernel" at 0xc02e0000. Preloaded userconfig_script "/boot/kernel.conf" at 0xc02e009c. Pentium Pro MTRR support enabled md0: Malloc disk npx0: on motherboard npx0: INT 16 interface pcib0: on motherboard pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 pci1: at 0.0 irq 11 isab0: at device 4.0 on pci0 isa0: on isab0 atapci0: port 0xb800-0xb80f at device 4.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 pci0: at 4.2 irq 12 chip1: port 0xe800-0xe80f at device 4.3 on pci0 xl0: <3Com 3c905B-TX Fast Etherlink XL> port 0xb000-0xb07f mem 0xde800000-0xde80007f irq 12 at device 9.0 on pci0 xl0: Ethernet address: 00:50:04:a7:16:2f miibus0: on xl0 xlphy0: <3Com internal media interface> on miibus0 xlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto xl0: supplying EUI64: 00:50:04:ff:fe:a7:16:2f xl1: <3Com 3c905B-TX Fast Etherlink XL> port 0xa800-0xa87f mem 0xde000000-0xde00007f irq 10 at device 10.0 on pci0 xl1: Ethernet address: 00:01:02:7c:d4:cd miibus1: on xl1 xlphy1: <3Com internal media interface> on miibus1 xlphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto fdc0: at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0 fdc0: FIFO enabled, 8 bytes threshold fd0: <1440-KB 3.5" drive> on fdc0 drive 0 atkbdc0: at port 0x60-0x6f on isa0 atkbd0: irq 1 on atkbdc0 vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 sc0: on isa0 sc0: VGA <16 virtual consoles, flags=0x200> sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0 sio0: type 16550A sio1 at port 0x2f8-0x2ff irq 3 on isa0 sio1: type 16550A ppc0: at port 0x378-0x37f irq 7 on isa0 ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/9 bytes threshold ppi0: on ppbus0 lpt0: on ppbus0 lpt0: Interrupt-driven port plip0: on ppbus0 IP packet filtering initialized, divert enabled, rule-based forwarding enabled, default to deny, logging limited to 100 packets/entry by default IPv6 packet filtering initialized, default to accept, logging limited to 100 packets/entry IP Filter: initialized. Default = pass all, Logging = enabled IP Filter: v3.3.8 ata1-slave: identify retries exceeded ad0: 8063MB [16383/16/63] at ata0-master using UDMA33 ad1: 9787MB [19885/16/63] at ata0-slave using UDMA33 acd0: CDROM at ata1-master using PIO4 Mounting root from ufs:/dev/ad0s1a xl0: starting DAD for fe80:0001::0250:04ff:fea7:162f xl1: starting DAD for fe80:0002::0201:02ff:fe7c:d4cd xl1: DAD complete for fe80:0002::0201:02ff:fe7c:d4cd - no duplicates found xl0: DAD complete for fe80:0001::0250:04ff:fea7:162f - no duplicates found To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message