From owner-freebsd-questions@FreeBSD.ORG Tue Feb 5 11:55:25 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 572DB16A41B for ; Tue, 5 Feb 2008 11:55:25 +0000 (UTC) (envelope-from lachlan@lkla.org) Received: from paul.kawaguchichurch.org (pd5e374.sitmff01.ap.so-net.ne.jp [202.213.227.116]) by mx1.freebsd.org (Postfix) with ESMTP id CC56B13C46A for ; Tue, 5 Feb 2008 11:55:24 +0000 (UTC) (envelope-from lachlan@lkla.org) Received: from sm.lkla.org (localhost [127.0.0.1]) by paul.kawaguchichurch.org (8.14.2/8.14.2) with ESMTP id m15BHsWA053236 for ; Tue, 5 Feb 2008 20:17:54 +0900 (JST) (envelope-from lachlan@lkla.org) Received: from 137.153.0.37 (SquirrelMail authenticated user lachlan) by sm.lkla.org with HTTP; Tue, 5 Feb 2008 20:17:54 +0900 (JST) Message-ID: <1153.137.153.0.37.1202210274.squirrel@sm.lkla.org> Date: Tue, 5 Feb 2008 20:17:54 +0900 (JST) From: "Lachlan Michael" To: freebsd-questions@freebsd.org User-Agent: SquirrelMail/1.4.13 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-2022-jp Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Memory Error using Mailman on FreeBSD. How to debug? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lachlan@lkla.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2008 11:55:25 -0000 I have a question about debugging a memory error on FreeBSD. When a user sends an e-mail with an attachment above about 500kB to a very small mailing list (4 members), Mailman on my server aborts processing with the error MemoryError : out of memory After talking on the Mailman list, the advice was that python and Mailman are just returning the fact that enough memory can't be allocated, and it could be a FreeBSD problem. Specifically, > MemoryError is beyond the control of both Mailman and Python. Python is > requesting additional memory form the OS for the process and is being > denied. This is some kind of hardware or OS limitation. It could be > that the OS itself is running out of real or virtual memory or the > process is running into some process limit. This is a FreeBSD question. and some sympathy in that > 500KB is not a big message. This should not be happening. I am only > guessing, but I think there must be some per-process memory limitation > in your OS that is set way too low. I have run memtest previously and found no problems, also no problems when upgrading ports or world, so I believe the RAM is ok. The machine is otherwise lightly loaded. Although I believe I have a very vanilla flavored FreeBSD machine, I probably have some setting or parameter incorrectly set. Any hints on how to debug this problem and where to look at? Machine Details (i386, 1G RAM) ========================== # sysctl -a | grep version kern.version: FreeBSD 6.3-PRERELEASE #0: Wed Jan 2 18:46:42 JST 2008 # sysctl -a | grep mem memdesc 1 4K - 1 4096 vm.kmem_size: 335544320 vm.kmem_size_max: 335544320 vm.kmem_size_scale: 3 hw.physmem: 1052151808 hw.usermem: 881700864 hw.realmem: 1065287680 # limits Resource limits (current): cputime infinity secs filesize infinity kB datasize 524288 kB stacksize 65536 kB coredumpsize infinity kB memoryuse infinity kB memorylocked infinity kB maxprocesses 5547 openfiles 11095 sbsize infinity bytes vmemoryuse infinity kB For memory problems it seems that vmstat is used, so I'll include output when the problem occurs (i.e. sending a large attachment) and also when sending a normal mail to exactly the same list. As far as I can see, there seems to be plenty of physical memory available in both cases. vmstat when problem occurs* (receiving large attachment in mail) ======================================================== procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad4 cd0 in sy cs us sy id 1 3 0 355056 225104 0 0 0 0 0 0 0 0 137 275 344 0 1 99 0 3 0 355056 225104 127 0 0 0 103 0 0 0 154 444 379 0 3 97 0 3 0 355056 225104 93 0 0 0 69 0 0 0 157 419 387 0 2 98 0 3 0 355056 225104 127 0 0 0 103 0 0 0 165 459 404 1 1 99 0 3 0 355056 225100 186 0 0 0 138 0 3 0 185 543 451 0 1 99 0 3 0 355056 225100 127 0 0 0 103 0 0 0 196 465 467 0 3 97 0 3 0 356044 224556 341 0 0 0 138 0 0 0 203 980 482 0 3 97 0 3 0 356068 224332 141 0 0 0 103 0 1 0 643 1775 1356 0 1 99 0 3 0 356068 224080 0 0 0 0 0 0 2 0 714 1673 1504 1 1 97 0 3 0 356068 223872 127 0 0 0 103 0 1 0 729 1854 1527 1 4 95 0 3 0 356068 223664 0 0 0 0 0 0 2 0 735 1675 1545 0 2 98 0 3 0 355060 223340 2850 0 0 0 2898 0 38 0 307 5751 1055 13 6 81 *1 3 0 355140 223168 11192 0 0 0 10850 0 6 0 244 17322 821 63 17 20 0 3 0 354688 223524 917 0 0 0 981 0 3 0 196 668 473 1 4 95 0 3 0 354688 223524 93 0 0 0 69 0 0 0 162 407 399 0 1 99 0 3 1 354688 223524 34 0 0 0 34 0 0 0 166 312 415 0 1 99 1 3 0 354688 223524 93 0 0 0 69 0 0 0 163 423 400 0 2 98 0 3 0 354688 223524 34 0 0 0 34 0 0 0 149 324 372 0 1 99 0 3 0 354688 223524 0 0 0 0 4 0 7 0 166 271 411 0 1 99 0 3 0 354688 223524 34 0 0 0 34 0 0 0 170 305 410 1 1 98 vmstat output when no problem** doing the same task ============================================== procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad4 cd0 in sy cs us sy id 1 3 0 354688 224360 211 0 0 0 181 1 0 0 126 544 335 2 1 98 0 3 0 354688 224360 96 0 0 0 69 0 0 0 147 412 365 1 1 98 0 3 0 354688 224360 127 0 0 0 103 0 0 0 146 447 367 0 1 99 0 3 0 354688 224360 186 0 0 0 138 0 0 0 154 598 383 0 1 99 0 3 0 354688 224360 127 0 0 0 103 0 2 0 162 462 400 1 4 96 0 3 0 354688 224360 0 0 0 0 4 0 6 0 159 281 397 0 1 99 0 2 1 354688 224360 318 0 0 0 247 0 0 0 171 688 425 0 1 99 0 2 1 354688 224360 93 0 0 0 69 0 0 0 169 409 411 1 1 98 0 3 0 354688 224360 127 0 0 0 103 0 0 0 170 464 427 0 2 98 0 3 0 354688 224360 186 0 0 0 138 0 0 0 151 548 374 1 1 98 0 3 0 354688 224360 127 0 0 0 103 0 0 0 150 445 375 0 2 98 0 3 0 354688 224360 93 0 0 0 69 0 0 0 144 403 356 0 1 99 0 3 0 354688 224360 34 0 0 0 34 0 4 0 156 323 401 0 2 98 0 3 0 354688 224360 186 0 0 0 138 0 0 0 178 555 425 0 2 98 0 3 0 354688 224360 127 0 0 0 103 0 0 0 171 456 417 1 1 97 0 3 0 354688 224360 93 0 0 0 69 0 0 0 175 406 417 1 1 98 0 3 0 354688 224344 1775 0 0 0 1614 0 18 0 246 5384 649 6 5 89 1 4 0 366760 214072 2959 0 0 0 293 0 22 0 260 8265 698 35 4 61 **1 4 0 396320 186384 7154 0 0 0 203 0 8 0 248 13599 615 87 13 0 0 4 0 398500 184404 683 0 0 0 148 0 8 0 181 1634 439 53 3 44 0 4 0 398500 184396 37 0 0 0 35 0 0 0 170 347 407 0 2 98 0 4 0 398536 184376 98 0 0 0 69 0 0 0 168 537 411 0 1 99 0 4 0 398536 184376 128 0 0 0 104 0 0 0 156 520 393 0 1 99 0 4 0 398536 184376 186 0 0 0 138 0 0 0 159 536 389 1 1 98 1 4 0 398536 184376 128 0 0 0 104 0 3 0 166 448 411 0 1 99 0 4 0 398536 184376 93 0 0 0 69 0 0 0 151 414 372 0 1 99 0 4 0 398536 184376 128 0 0 0 104 0 0 0 153 437 373 1 1 98 0 4 0 398536 184376 186 0 0 0 138 0 0 0 157 550 393 0 3 97 0 4 0 398544 184368 130 0 0 0 104 0 0 0 178 545 428 1 1 97 0 4 0 399100 184184 61 0 0 0 0 0 0 0 163 379 397 0 1 99 Regards, Lachlan