Reliable/Failsafe Applications

Matthias Kretschmer <[email protected]> Tue, 6 Feb 2007 07:56:46 +0100
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
Hello,

some time ago I asked about how difficult it is to get an out-of-memory
exception in SML/NJ.  I understand that this is not so easy, because one may
need to allocate memory when running the exception handler.  To solve this
problem, if I would want to write a reliable and failsafe application (like a
service-daemon), I have to take care of the memory consumption myself.  To be
concrete: I want to be sure that I don't consume too much memory and the
application will break before I can do something about it.  One way would be of
course to limit connections and such stuff and ensure that only up to a fix
bound of memory is consumed.  The other way would be to read out the current
memory consumption and the limits given by the operating system to make sure
that no too much memory will be consumed and cut number of connections (or
whatever) to stick below the limit.  My question is now, is there a portable way
to get this information in sml/nj?  Do I need to interface to C to do this?  I
once read that some garbage collectors use the memory free & memory free
information to determine when a garbage collection will occur (like if there is
not much memory left the garbage collection frequency increases).  Does this
stuff the SML/NJ garbage collector?  Do I get such information out of it?

Thanks for the help in advance.
Matthias Kretschmer

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642