[MLton-devel] MM with two mlton apps
Alain Deutsch
deutsch@polyspace.com
Sun, 21 Jul 2002 11:18:49 +0200 (MET DST)
We have the following phenomenon: one of our applications
repetitively calls another. Both are, of course, MLton compiled.
With the new release, the first application sometimes occupies
more than 50% of the RAM, which is OK. It then spawns the second
one, which believes it has all RAM. But of course this is not
necessarily the case and the second app, through the kernel pager,
has to page out the first in order to work. When control returns
to the first app, it in turn has to page itself in, which is
costly.
An important information is that while the second app runs, the
first is completely idle. The present problem is thus not that of
sharing RAM between two processes.
The problem described above tends to be more marked with the new
mlton version as it releases toSpace only when necessary, which is
OK to me.
What we would need, though, would be a means for the first app to
tell the runtime "OK, pack" before spawning the second app.
I did a first attempt by adding to the gc a global function
callable from ML (through _ffi), which just calls releaseToSpace.
However, I think we could do better. A first way would be to do
(from ML, first app):
1) call GC()
2) call releaseToSpace()
3) spawn(second app)
However, I was wondering if this is really optimal as we only need
to call GC in case the mutator has allocated significantly since
the last GC.
What is your opinion ?
--
Alain Deutsch, CTO tel.: +33 (0)1 49 65 32 64
PolySpace Technologies fax.: +33 (0)1 49 65 05 77
mailto:deutsch@POLYSPACE.COM http://www.polyspace.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel