dcosson / vagrant-unison2

Vagrant plugin to sync local files to VM using Unison over SSH
MIT License
50 stars 8 forks source link

Add a background thread to kill vagrant when memory use gets high #2

Closed dcosson closed 8 years ago

dcosson commented 8 years ago

Turns out there's a pretty severe memory leak in the VM with unison running.

This adds a background thread that checks how much memory unison is using in the VM every few seconds and restarts it if above the threshhold. Right now the threshold is somewhat arbitrarily chosen at 100mb, which ends up restarting unison every 10-20 min or so on my macbook pro.

Also updates the README with the recommended way of running.

bwegrzyn commented 8 years ago

Can this value be made configurable? I have a rather large code base, and it is restarting unison every ~30 seconds.

dcosson commented 8 years ago

@bwegrzyn yeah I'll add it to the config variables

dcosson commented 8 years ago

@bwegrzyn This value is now configurable in 1.2.2 as config.unison.mem_cap_mb

bwegrzyn commented 8 years ago

@dcosson Perfect, thanks! I'll give it a try when I have a moment.