[gclist] Java vs. ML, particularly GC
Fri, 05 Jan 2001 18:17:07 +0300
"Krishnaswami, Neel" wrote:
> Dave Mason [mailto:dmason@sarg.Ryerson.CA] wrote:
> > I have 10-20K lines of coding experience in SML, Caml, Scheme (, and
> > [skip]
> > 1) opinions on the accuracy of this perception?
> True, but keep in mind that ML and Ocaml have highly-optimizing
> native code compilers, and you are comparing it to a bytecode
> system. Of course, if native MLs exists on all the platforms you
> care about then Java still loses.
I suppose Dave compares to bytecode versions of OCaml and SML...
As to original question, I think the most important difference between
OCaml and SML and Java, is that the former two, being functional
makes less reference updates, thus allowing better performance
of generational collector.
In OCaml implementation, they use 2-age generational collector,
young heap is collected by a copying collector, and
major heap - by incremental mark&sweep. This is very fast,
as you understand - I suppose, the fastest possible.
Of course, as usually the big problem is pointers from
major heap to minor heap, but those are rare in functional
languages, so thay just have a table of references from major
to young heap (not very big) and include it in roots for
minor collections. At every minor collection, table is cleared.
Whenever table overfills, minor collection is performed.
For Java, this is unacceptable, because pointers from major
to minor heap will appear all the time.
Dmitry S. Lomov
mailto:firstname.lastname@example.org ICQ#: 20524819 (Rusty)
+7 (812) 428-46-57 (b) +7 (812) 295-94-15 (h)