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

jiaoyingtian jiaoyingtian at nrchpc.ac.cn
Sun Feb 7 22:41:07 EST 2010


Hello Jerome Vouillon,
Thanks a lot for doing me a favor last time~, There is another question to ask 
you.
I have edited the "main.ml" like this :
  ignore (Gc.set {(Gc.get ()) with Gc.max_overhead = 10});
and complied it.
but the memory which  be used by unison  is also up now,it is 20m.
I want to know whether this condition is  normal or not. In my opinion ,i want 
to control the memory below 10m.So please help me.
Please response all.
Thanks very much!



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


More information about the Unison-hackers mailing list