caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Florian Hars <florian@hars.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Debugging memory-intensive programs...
Date: Fri, 9 Nov 2001 16:50:23 +0100	[thread overview]
Message-ID: <20011109165023.C22074@ice.gerd-stolpmann.de> (raw)
In-Reply-To: <20011109153803.A339@hars>; from florian@hars.de on Fri, Nov 09, 2001 at 15:38:03 +0100

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


      reply	other threads:[~2001-11-09 15:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-09 14:38 Florian Hars
2001-11-09 15:50 ` Gerd Stolpmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011109165023.C22074@ice.gerd-stolpmann.de \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=florian@hars.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).