From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA18301; Fri, 9 Nov 2001 16:50:32 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA18222 for ; Fri, 9 Nov 2001 16:50:31 +0100 (MET) Received: from mout01.kundenserver.de (mout01.kundenserver.de [195.20.224.132]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id fA9FoUn17678 for ; Fri, 9 Nov 2001 16:50:30 +0100 (MET) Received: from [172.19.20.60] (helo=mrelayng0.kundenserver.de) by mout01.kundenserver.de with esmtp (Exim 2.12 #2) id 162DvH-0007pa-00; Fri, 9 Nov 2001 16:50:27 +0100 Received: from [62.54.75.171] (helo=ice.gerd-stolpmann.de) by mrelayng0.kundenserver.de with asmtp (Exim 3.22 #2) id 162DvG-0004EC-00; Fri, 09 Nov 2001 16:50:26 +0100 Received: from ice (gerd@localhost [127.0.0.1]) by ice.gerd-stolpmann.de (8.12.1/8.12.1) with ESMTP id fA9FoNw5014059; Fri, 9 Nov 2001 16:50:24 +0100 Date: Fri, 9 Nov 2001 16:50:23 +0100 From: Gerd Stolpmann To: Florian Hars Cc: caml-list@inria.fr Subject: Re: [Caml-list] Debugging memory-intensive programs... Message-ID: <20011109165023.C22074@ice.gerd-stolpmann.de> References: <20011109153803.A339@hars> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit In-Reply-To: <20011109153803.A339@hars>; from florian@hars.de on Fri, Nov 09, 2001 at 15:38:03 +0100 X-Mailer: Balsa 1.2.1 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On 2001.11.09 15:38 Florian Hars wrote: > Timetravel considered harmful: > > I just tried to debug a program that reads a lot of data and keeps > a significant part of it in memory because it died with a string > or array out of bounds exception halfway through it's input. > Here is part of what syslog said when I ran it in ocamldebug: That's one of the memory management problems of Linux. It overcommits memory, i.e. you can allocate more memory than you really have (including swap space). On the one hand, this allows to better exhaust memory, but on the other hand, there is no real criterion whether memory is out or not. In the best case, the process writing to a memory page gets a segfault. The worst case is that the kernel needs itself memory and begins to kill processes (this is what you see in the syslog). See http://lwn.net/2000/0309/kernel.php3 Because ocamldebug checkpoints the program state by forking subprocesses, there are a lot "copy-on-write" memory pages, so it is likely that you run into this problem. Possible solutions: - Increase swapspace - Decrease the number of checkpoints of ocamldebug (set processcount, also set bigstep, set smallstep) > Nov 9 15:06:33 quetelet kernel: VM: do_try_to_free_pages failed for > kswapd... > Nov 9 15:06:34 quetelet kernel: VM: do_try_to_free_pages failed for > mozilla-bin... > Nov 9 15:06:57 quetelet last message repeated 4 times > Nov 9 15:06:57 quetelet kernel: VM: do_try_to_free_pages failed for > apache... > Nov 9 15:07:01 quetelet kernel: VM: do_try_to_free_pages failed for > kswapd... > > [...] > > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > sshd... > Nov 9 15:14:41 quetelet last message repeated 4 times > Nov 9 15:14:41 quetelet kernel: VM: killing process sshd > > [...] > > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > emacs... > Nov 9 15:14:41 quetelet last message repeated 16 times > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > bash... > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > klogd... > Nov 9 15:14:41 quetelet last message repeated 15 times > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > proftpd... > Nov 9 15:14:41 quetelet last message repeated 15 times > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > XF86_Mach64... > Nov 9 15:14:41 quetelet last message repeated 15 times > > [...] > > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > emacs... > Nov 9 15:14:41 quetelet last message repeated 16 times > Nov 9 15:14:41 quetelet kernel: VM: killing process emacs > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > bash... > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > inetd... > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > bash... > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > editor... > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > mutt... > Nov 9 15:14:41 quetelet kernel: VM: do_try_to_free_pages failed for > syslogd... > > Guess I have to do something else... :-) > > Yours, Florian Hars. > ------------------- > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: > http://caml.inria.fr/FAQ/ > To unsubscribe, mail caml-list-request@inria.fr Archives: > http://caml.inria.fr > ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr