Skip navigation

Monthly Archives: March 2017

For the way I use PhantomJS, it has a habit of hanging and leaving me with a bunch of zombie phantomjs.exe processes. My solution was to put together a timer that would periodically kill all phantomjs.exe processes (and all their descendants) which were older than a specified number of minutes. It’s mildly elegant, but also mildly brutish, and much more overhead than I wanted.

I can’t believe this didn’t occur to me sooner. The easier, cleaner way is to add the following to the script you’re having it run:

Now all my phantomjs.exe instances reliably off themselves once the timer elapses.

I recently moved a RavenDB database from a VM with Windows Server 2012 to a new VM with Windows Server 2016 by way of a dump file because I wanted everything to be fresh. Once the import was complete and the new RavenDB installation tried to index my documents using the old indexes I had constructed, I saw this error pop up in the log dozens of times: Common Language Runtime detected an invalid program.

Luckily, I managed to find that one obscure post in the RavenDB Google Group that pointed me in the direction of the solution, which is to force RavenDB to use the old JIT compiler instead of the new RyuJIT that runs by default with .NET Framework 4.6 installations.

In your RavenDB directory, edit  Raven.Server.exe.config and ensure that <useLegacyJit enabled="1" /> is in the <runtime> section, like so: