Date: Wed, 13 Sep 2000 12:45:13 -0700 From: Cove Schneider <cove@clearink.com> To: freebsd-questions@FreeBSD.ORG Subject: Unable to use all swap? (How to up proc. memory limits?) Message-ID: <20000913124513.R79801@clearink.com>
next in thread | raw e-mail | index | archive | help
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 <unistd.h> 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<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,XMM> 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: <math processor> on motherboard npx0: INT 16 interface pcib0: <Intel 82443BX (440 BX) host to PCI bridge> on motherboard pci0: <PCI bus> on pcib0 pcib1: <Intel 82443BX (440 BX) PCI-PCI (AGP) bridge> at device 1.0 on pci0 pci1: <PCI bus> on pcib1 pci1: <ATI Rage128-RL graphics accelerator> at 0.0 irq 11 isab0: <Intel 82371AB PCI to ISA bridge> at device 4.0 on pci0 isa0: <ISA bus> on isab0 atapci0: <Intel PIIX4 ATA33 controller> port 0xb800-0xb80f at device 4.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 pci0: <Intel 82371AB/EB (PIIX4) USB controller> at 4.2 irq 12 chip1: <Intel 82371AB Power management controller> 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: <MII bus> 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: <MII bus> on xl1 xlphy1: <3Com internal media interface> on miibus1 xlphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto fdc0: <NEC 72065B or clone> 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: <keyboard controller (i8042)> at port 0x60-0x6f on isa0 atkbd0: <AT Keyboard> irq 1 on atkbdc0 vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 sc0: <System console> 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: <Parallel port> 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: <Parallel I/O> on ppbus0 lpt0: <Printer> on ppbus0 lpt0: Interrupt-driven port plip0: <PLIP network interface> 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 <FUJITSU MPE3084AE> [16383/16/63] at ata0-master using UDMA33 ad1: 9787MB <WDC AC310200R> [19885/16/63] at ata0-slave using UDMA33 acd0: CDROM <SAMSUNG SC-140B> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000913124513.R79801>