From: Alexander Fuchs <alexander.fuchs@uni-koblenz.de>
To: caml-list@yquem.inria.fr
Subject: Limiting Memory Usage
Date: Thu, 13 Jul 2006 23:39:40 -0400 [thread overview]
Message-ID: <44B711FC.7000001@uni-koblenz.de> (raw)
Hi,
I would like to:
- limit the max. memory usage of an ocaml program
- and do some cleanup and then terminate then program, when this limit
is reached.
I couldn't see how to do that with the standard libraries, so I added a
C-wrapper to use setrlimit with RLIMIT_AS. I guess that works only with
Linux, which is not nice but better than nothing.
Still, when the memory limit is reached the program just terminates with
"Fatal error: out of memory." resp "Out of memory". I couldn't figure
out if it is possible to catch any of those errors/exceptions, and do
some cleanup before terminating the program.
Does perhaps someone know how to provide this functionality in a more
satisfactory way?
Thanks,
Alexander
next reply other threads:[~2006-07-14 3:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-14 3:39 Alexander Fuchs [this message]
2006-07-14 12:52 ` [Caml-list] " Chris King
2006-07-15 17:04 ` Alexander Fuchs
2006-07-17 8:15 ` Damien Doligez
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=44B711FC.7000001@uni-koblenz.de \
--to=alexander.fuchs@uni-koblenz.de \
--cc=caml-list@yquem.inria.fr \
/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