Thanks, Ken. I've changed that in my program now. I've also found that one reason why the Clojure benchmarks on the shootout web site were using so much more memory than the corresponding Java programs (e.g. up to about 350 Mbytes for the fannkuch-redux benchmark program) is a combination of several factors:
(1) the Clojure programs were generating garbage, i.e. allocating memory that later became unused. Even though the total amount of live objects at any one time was well under 4 MBytes for the fannkuch-redux benchmark program, for example, it was not being collected soon enough to keep the amount of resident memory low. (2) That combined with the default heap size and GC method used, when no special command line arguments were being used on the java command line, led to large measured memory usage. By selecting an appropriate maximum heap size using the -Xmx command line option, the maximum resident memory used by several of the Clojure (and also JRuby) programs have been reduced significantly. Several of the programs formerly had their memory use 30x the corresponding Java program. Now the worst case ratio of (Clojure memory use / Java memory use) is about 3x, and there are still several programs for which I haven't yet run the experiments to find an appropriate max heap size to use. After that happens, the average memory use of Clojure programs (and JRuby programs) will go down further. Here is a link where you can see the results for the one-core 32-bit benchmark machine, for example: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=clojure Does anyone know a way from within a Java/Clojure program to determine which GC algorithm is currently in use? I'm curious what the default is when one is not specified on the command line, and accessing the one being used from inside of a program would be one good way to find out for sure. There doesn't seem to be anything returned by Runtime.getRuntime().getProperties() to indicate that. Andy On Mon, Nov 22, 2010 at 9:51 AM, Ken Wesson <kwess...@gmail.com> wrote: > On Mon, Nov 22, 2010 at 11:47 AM, John Fingerhut > <andy.finger...@gmail.com> wrote: > > max live=63.1 MB - The maximum heap size before any GC invocation > > was 63.1 MB. The name "max live" is probably not the best name > > for that value, since objects in heap before a GC begins are often > > not all live. > > You'll get a much better approximation to the concept of "max live" > from the maximum heap size right AFTER any GC invocation. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com<clojure%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en