[Unison-hackers] How to set unison to begin cllocting the garbage?

Jerome Vouillon Jerome.Vouillon at pps.jussieu.fr
Thu Feb 4 03:39:51 EST 2010


On Tue, Feb 02, 2010 at 04:47:18PM +0800, jiaoyingtian wrote:
> I use the unison to sync the file, but the the unison has used to much 
> memory.So i like to know whether can set the garbage collection for unison? 
> For example if the unison has used 50m memory then unison begin to
> collect the garbage.

You can tell unison to perform garbage collection more aggressively by
setting the environment variable OCAMLRUNPARAM to something like:
"o=20".  This number may be to aggressive (this will slow down
Unison).  The default is 80.  You can use "man ocamlrun" for some
documentation.


There is another parameter you can play with, but you will have to
recompile unison.  You need to edit file "main.ml" and put a lower
value on this line:

  ignore (Gc.set {(Gc.get ()) with Gc.max_overhead = 150});


You can also add "xferbycopying = false" to your profile.  This option
is quite memory intensive.  Note that you will then get a performance
hit when a file to propagate already exists on the target replica (for
instance because it was renamed on the source replica), as Unison will
transfer its contents rather that copying it locally.

-- Jerome


More information about the Unison-hackers mailing list