caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Limiting Memory Usage
@ 2006-07-14  3:39 Alexander Fuchs
  2006-07-14 12:52 ` [Caml-list] " Chris King
  2006-07-17  8:15 ` Damien Doligez
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Fuchs @ 2006-07-14  3:39 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-17  8:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-14  3:39 Limiting Memory Usage Alexander Fuchs
2006-07-14 12:52 ` [Caml-list] " Chris King
2006-07-15 17:04   ` Alexander Fuchs
2006-07-17  8:15 ` Damien Doligez

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).