title: Hyper-V PLINQ Virtual Machine Parallel issue
body: <p>I have a PLINQ query as such...</p>
  
  <pre><code>batch
  .AsParallel()
  .WithExecutionMode(ParallelExecutionMode.ForceParallelism)
  .WithCancellation(cancellationToken);
  .Select(i =&gt; new { instruction = i, accountKey = new AccountKey(i.x, i.y, i.z) })
  .GroupBy(x =&gt; x.accountKey)
  .ForAll(grouping =&gt;
  {
      foreach (var instructionBatch in grouping.OrderBy(i =&gt; i.instruction.FileRow).Select(i =&gt; i.instruction))
      {
          // High CPU method.
      }
  });
  </code></pre>
  
  <p>In a batch, there can be 10,000 records. These make calls to the High CPU method which in turn is making calls out to web-services and saving info to databases.</p>
  
  <p>On my physical 64bit pc i7-4770 CPU @ 3.40 GHz 16.0GB ram. The service where this code is run from fires up around 32 threads and sits around 150,000 - 200,000 KB memory usage. </p>
  
  <p>On a Hyper-V test environment which is a 64 bit virtual machine E5-2630 v3 @2.40GHz it generates over 200 threads and memory hits nearly the 2gb limit.</p>
  
  <p>Is there any reason why it is firing up so many threads and why memory is not being released on the virtual machine? </p>
  
  <p>Do I need to use WithDegreeOfParallelism. If this process might be called simultaneously with 4 different batches (1 x 1 record, 1 x 100 records, 1 x 1000 and 1 x 10,000 for example) does this mean that when if I specify a WithDegreeOfParallelism the 4 batches will each fire with that number of threads, even the batch of 1 record?</p>
  
  <p>Thanks for any assistance.</p>