[MLton-devel] GC problem

Alain Deutsch deutsch@polyspace.com
Tue, 13 Aug 2002 16:02:04 +0200 (MET DST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-1382141583-1029247324=:2029
Content-Type: TEXT/PLAIN; charset=US-ASCII

1) I downloaded version 20020728 which I patched with the latest
version of resizeHeap() as recommended by Stephen.

It compiles OK and runs reasonably at first, except that munmap
failures occur during recompilation with itself (bootstrap). These
failures are flagged with the EINVAL errno, which occurs because
the size passed to munmap is sometimes not a multiple of pagesize.

I turned on debugging and got confirmation of the problem.

gc.c 976: assert(isPageAligned (s, keep)) failed.

A first source seems to lie in the fact that the computation of
KEEP in RESIZEHEAP is not necessarily followed by a ROUNDPAGE.

A second source of non aligned arguments to munmap seems to reside
in the fact that the SIZE in the else branch of the "if (not
grow)" conditional is not necessarily a multiple of pagesize as it
is ultimately defined as a number of live bytes. Is there here
also a need to a ROUNDPAGE ?

Adding these two roundpage calls seems to correct the problem.

2) In the Sansom 1991 article on GC, I understand that they
recommend as a criterion for switching from stop-and-copy to
mark-compact live_ratio >= 0.3 * maxheap (where 0.3 is the r*
ratio from the article). I tried this in doGc, and did as a
benchmark a self compile of mlton. I got the following:

GC time  GC%
107.5s	 35% (22 copy, 42 compact)
24.8s    16% (47 copy, 0 compact) 

It is true that previous switching criterion is safer in that it
will avoid swapping more strictly. However in practice I think
that often only parts of fromSpace are paged in.

Enclosed is the gc.c file containing these two modifications (bug
fix + new criterion) on top of rev. 1.66 + resizeHeap() from 1.68.

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

---559023410-1382141583-1029247324=:2029
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="gc.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.05.10208131602040.2029@pst>
Content-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NrZWQgaGVhcCBvZiBzaXplICVzLlxuIiwNCgkJCQl1aW50
VG9Db21tYVN0cmluZyAocy0+aGVhcC5zaXplKSk7DQoJbGVhdmUgKHMpOw0K
fQ0K
---559023410-1382141583-1029247324=:2029--


-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel